You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+27-16Lines changed: 27 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ layout:
91
91
config:
92
92
scrollZoom: false
93
93
94
-
hours_to_show: 1
94
+
hours_to_show: 1h
95
95
refresh_interval: 10# in seconds
96
96
```
97
97
@@ -104,7 +104,7 @@ type: custom:plotly-graph
104
104
entities:
105
105
- entity: sensor.temperature
106
106
refresh_interval: 10
107
-
hours_to_show: 12
107
+
hours_to_show: 12h
108
108
layout:
109
109
xaxis:
110
110
rangeselector:
@@ -298,31 +298,31 @@ defaults:
298
298
299
299
## Offsets
300
300
301
-
Offsets are useful to shift data in the temporal axis. For example, if you have a sensor that reports the forecasted temperature 3 hours from now, it means that the current value should be plotted in the future. With the `offset` attribute you can shift the data so it is placed in the correct position.
301
+
Offsets are useful to shift data in the temporal axis. For example, if you have a sensor that reports the forecasted temperature 3 hours from now, it means that the current value should be plotted in the future. With the `time_offset` attribute you can shift the data so it is placed in the correct position.
302
302
Another possible use is to compare past data with the current one. For example, you can plot yesterday's temperature and the current one on top of each other.
303
303
304
-
The `offset` flag can be specified in two places.
305
-
**1)** When used at the top level of the configuration, it specifies how much "future" the graph shows by default. For example, if `hours_to_show` is 16 and `offset` is 3h, the graph shows the past 13 hours (16-3) plus the next 3 hours.
304
+
The `time_offset` flag can be specified in two places.
305
+
**1)** When used at the top level of the configuration, it specifies how much "future" the graph shows by default. For example, if `hours_to_show` is 16 and `time_offset` is 3h, the graph shows the past 13 hours (16-3) plus the next 3 hours.
306
306
**2)** When used at the trace level, it offsets the trace by the specified amount.
307
307
308
308
```yaml
309
309
type: custom:plotly-graph
310
310
hours_to_show: 16
311
-
offset: 3h
311
+
time_offset: 3h
312
312
entities:
313
313
- entity: sensor.current_temperature
314
314
line:
315
315
width: 3
316
316
color: orange
317
317
- entity: sensor.current_temperature
318
318
name: Temperature yesterday
319
-
offset: 1d
319
+
time_offset: 1d
320
320
line:
321
321
width: 1
322
322
dash: dot
323
323
color: orange
324
324
- entity: sensor.temperature_12h_forecast
325
-
offset: 12h
325
+
time_offset: 12h
326
326
name: Forecast temperature
327
327
line:
328
328
width: 1
@@ -346,13 +346,13 @@ When using offsets, it is useful to have a line that indicates the current time.
346
346
347
347
```yaml
348
348
type: custom:plotly-graph
349
-
hours_to_show: 6
350
-
offset: 3h
349
+
hours_to_show: 6h
350
+
time_offset: 3h
351
351
entities:
352
352
- entity: sensor.forecast_temperature
353
353
yaxis: y1
354
-
offset: 3h
355
-
- entity: ''
354
+
time_offset: 3h
355
+
- entity: ""
356
356
name: Now
357
357
yaxis: y9
358
358
showlegend: false
@@ -388,7 +388,7 @@ Whenever a time duration can be specified, this is the notation to use:
388
388
Example:
389
389
390
390
```yaml
391
-
offset: 3h
391
+
time_offset: 3h
392
392
```
393
393
394
394
## Extra entity attributes:
@@ -818,7 +818,7 @@ entities:
818
818
x: $fn ({ys,vars}) => ys
819
819
type: histogram
820
820
title: Temperature Histogram last 10 days
821
-
hours_to_show: 240
821
+
hours_to_show: 10d
822
822
raw_plotly_config: true
823
823
layout:
824
824
margin:
@@ -850,7 +850,7 @@ entities:
850
850
<b>Target:</b>%{y}</br>
851
851
<b>Current:</b>%{customdata.current_temperature}
852
852
<extra></extra>
853
-
hours_to_show: 24
853
+
hours_to_show: current_day
854
854
```
855
855
856
856
## Default trace & axis styling
@@ -923,7 +923,18 @@ When true, the custom implementations of pinch-to-zoom and double-tap-drag-to-zo
923
923
## hours_to_show:
924
924
925
925
How many hours are shown.
926
-
Exactly the same as the history card, except decimal values (e.g `0.1`) do actually work
926
+
Exactly the same as the history card, but more powerful
0 commit comments