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: docs/en/nodes/widgets/ui-chart.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -502,9 +502,41 @@ The changes are additive, so if it was also desired to move the bottom of the gr
502
502
}
503
503
}
504
504
```
505
-
The options set earlier will remain in force.
506
-
507
-
505
+
The options set earlier will remain in force. Generally a message containing `msg.ui_update` should contain no payload or other properties otherwise those will be interpreted as data to go on the chart.
506
+
### Setting Series Colour
507
+
The settings for each series on the chart can also be set using `msg.ui_update`. Note that when adjusting settings for a series you must include all
508
+
customised settings for all series, as each update to series configuration will replace any previous customisation to series.
509
+
For example, for a line chart with two lines 'temperature' and 'humidity', to set the colour of the temperature line to red and humidity to green `msg.ui_update` could be sent containing
510
+
```
511
+
{
512
+
"chartOptions": {
513
+
"series": [
514
+
{
515
+
"name": "temperature",
516
+
"type": "line",
517
+
"lineStyle": {
518
+
"color": "red",
519
+
},
520
+
"itemStyle": {
521
+
"color": "red"
522
+
},
523
+
},
524
+
{
525
+
"name": "humidity",
526
+
"type": "line",
527
+
"lineStyle": {
528
+
"color": "rgb(0, 255, 0)"
529
+
},
530
+
"itemStyle": {
531
+
"color": "rgb(0, 255, 0)"
532
+
},
533
+
}
534
+
]
535
+
}
536
+
}
537
+
```
538
+
Note that this sets the colour for the whole line. It cannot be used to change the colour for just a section of the line.
539
+
Any such message should always contain the series name and type for each series.
508
540
509
541
## Building Custom Charts
510
542
For even further customisataion such as rendering charts we don't yet support, you can use a UI Template node.
0 commit comments