The status-chart widget
Description
The status-chart widget combines the status widget with a chart in its background. The chart is displayed in the background of the widget without X and Y axis. By clicking on the tile, a popup opens in which the chart is displayed in full size with the axes.
Status with background chart.
<cv-status-chart format="%d" style="color: #f2495c" y-format="%d Wh" series="hour" x-format="%H:%M">
<cv-address slot="address" transform="DPT:7.001" mode="read">1/4/0</cv-address>
<span slot="title">Current power consumption</span>
<span slot="unit">W</span>
<dataset slot="dataset" src="openhab://Meter_Energy_Grid_Import_Today" title="grid withdrawal" color="#FF0000" show-area="true" curve="step"/>
</cv-status-chart>
Allowed attributes in the status-chart element
Element |
Attribute |
|||
|---|---|---|---|---|
Name |
Content |
Description |
||
cv-status-chart |
mapping |
string |
Map the bus value to a different value, text or symbol for displaying. See also mapping |
|
styling |
string |
Change the color of the displayed value depending on its value. See also styling |
||
format |
string |
Formatting of the value (printf syntax). |
||
selection |
string |
Type of the chart element. |
||
y-format |
string |
Format the value on the y-axis. (printf syntax) |
||
x-format |
string |
Format of the date on the x-axis. (see: https://d3js.org/d3-time-format#locale_format). If this value is not provided its automatically determined based on the currently shown ‘series’. Defining an explicit formatting overrides this. |
||
size |
button, 0.5x0.5, 1x0.5, 1x1, 2x1, 2x1.5, 1x2, 2x2, 2x4 or 4x2 |
Size of the tile in {columns}x{rows}, 1x1 is the default size. |
||
refresh |
decimal |
Time interval in seconds this widget is being refreshed. |
||
series |
hour, day, week, month or year |
Time span of the data. |
||
popup-title |
string |
Title of the popup. |
||
min |
decimal |
Minimum value. |
||
max |
decimal |
Maximum value. |
||
visible-on |
mobile or desktop |
Controls this element’s visibility by screen size. |
||
class |
string |
Add this value to the CSS class so that it can be formatted by a user provided style sheet. |
||
style |
string |
Custom CSS style rules for this widget. |
||
Allowed child elements and their attributes
Element |
Attribute |
|||
|---|---|---|---|---|
Structure |
Name |
Content |
Description |
|
|
slot |
address, tileAddress or liveUpdateAddress |
||
transform |
string |
Defines the datatype in the backend, e.g. DPT:1.001 for KNX datapoint type 1.001. |
||
mode |
disable, read, write or readwrite |
Defines if this address is only used to |
||
value |
string |
Fixed value sent to this address. |
||
on |
click, down or up |
Event on which a |
||
target |
string |
Target in the parent widget the value if this address should be use for. The possible values depend on the parent widget. |
||
format-pos |
decimal |
Position for format string when multiple addresses are used. |
||
qos |
decimal |
Only MQTT: QoS |
||
retain |
true or false |
Only MQTT: retain flag |
||
selector |
string |
Only MQTT: JSON selector |
||
backend |
string |
Optional name of the backend this address belongs to. |
||
mapping |
string |
Map the bus value to a different value, text or symbol for displaying. See also mapping |
||
format |
string |
Formatting of the value (printf syntax). |
||
delay |
positiveInteger |
Optional delay in milliseconds that a write-request to this address is delayed. |
||
send-mode |
on-change or always |
Usually the elements that are using this address receive an update-event only when that value hast changed ( |
||
Element |
Attribute |
|||
|---|---|---|---|---|
Structure |
Name |
Content |
Description |
|
|
slot |
title, popup-title or unit |
||
tr |
true or false |
Defines that the text content of this element should be translated. |
||
Element |
Attribute |
|||
|---|---|---|---|---|
Structure |
Name |
Content |
Description |
|
|
src |
anyURI |
Data source for this chart element |
|
title |
string |
Title of the chart element. |
||
chart-type |
line, bar or stacked-bar |
Type of the chart element. |
||
curve |
linear, step or natural |
Type of curve interpolation for line charts. |
||
color |
string |
Color of the chart element. |
||
show-area |
true or false |
Fill the area below a line diagram (default=true). |
||
gradient |
true or false |
Fill the area below a line diagram with a linear gradient (show-area must not be “false”). |
||
aggregation-interval |
integer |
Interval for aggregating data points (in minutes). |
||
|
string |
|||
Element |
Attribute |
|||
|---|---|---|---|---|
Structure |
Name |
Content |
Description |
|
|
src |
string |
Data source for this line |
|
color |
string |
Color of the line. |
||
show-value |
true or false |
Show value. |
||
value-color |
string |
Color of the value. |
||
value |
Type of the chart element. |
|||
format |
string |
Format the value on the y-axis. (printf syntax) |
||
Element |
Attribute |
|||
|---|---|---|---|---|
Structure |
Name |
Content |
Description |
|
|
src |
string |
Data source for this line |
|
color |
string |
Color of the line. |
||
show-value |
true or false |
Show value. |
||
value-color |
string |
Color of the value. |
||
value |
Date where the vertical line should be shown on the x-axis. |
|||
format |
string |
Format of the date on the x-axis. (see: https://d3js.org/d3-time-format#locale_format). |
||