Hi,
I have a temperature timeseries ui-chart,
the series is specified by topic, data from the sensors (mqqt) arrive at different timestamps.
Because I don't know which data arrives first when i start, the colors in the ui-chart are always different.
Is it possible to specify the color for the series in the payload?
Attached an example
[
{
"id": "236fbb7ba3fbf945",
"type": "group",
"z": "54882f66b0e8ee8e",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
"fill": "none",
"fill-opacity": "1",
"label": true,
"label-position": "nw",
"color": "#a4a4a4"
},
"nodes": [
"63aa7e0cd23d44b2",
"6160c5c434a8d971",
"4abe0f86f8c45932",
"248463f482afaee0",
"8ec51375dc45e70d",
"7bef089546e0e9f1",
"07c25d3586b3df20",
"ae713575410f0f70",
"999b10424ff13426",
"14fce2c960d1ad46",
"2493f68ccd014154"
],
"x": 184,
"y": 159,
"w": 702,
"h": 382
},
{
"id": "63aa7e0cd23d44b2",
"type": "ui-chart",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"group": "ec6dc23a8a89c2f3",
"name": "",
"label": "chart",
"order": 11,
"chartType": "line",
"category": "topic",
"categoryType": "msg",
"xAxisProperty": "",
"xAxisPropertyType": "msg",
"xAxisType": "time",
"yAxisProperty": "",
"ymin": "",
"ymax": "",
"action": "append",
"pointShape": "circle",
"pointRadius": 4,
"showLegend": true,
"removeOlder": 1,
"removeOlderUnit": "60",
"removeOlderPoints": "",
"colors": [
"#1f77b4",
"#aec7e8",
"#ff7f0e",
"#2ca02c",
"#98df8a",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"width": "12",
"height": "6",
"className": "",
"x": 810,
"y": 380,
"wires": [
[]
]
},
{
"id": "6160c5c434a8d971",
"type": "debug",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "debug 112",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 750,
"y": 500,
"wires": []
},
{
"id": "4abe0f86f8c45932",
"type": "inject",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 320,
"y": 300,
"wires": [
[
"248463f482afaee0"
]
]
},
{
"id": "248463f482afaee0",
"type": "function",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "clear",
"func": "\nmsg.payload =[]\n \n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 300,
"wires": [
[
"63aa7e0cd23d44b2"
]
]
},
{
"id": "8ec51375dc45e70d",
"type": "comment",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "multi line timeseries chart",
"info": "",
"x": 320,
"y": 200,
"wires": []
},
{
"id": "7bef089546e0e9f1",
"type": "function",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "function 70",
"func": "var min = 10\nvar max = 20\nmin = Math.ceil(min);\n\nmsg.payload = Math.floor(Math.random() * (max - min)) + min;\nmsg.topic = \"outside\"\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 530,
"y": 380,
"wires": [
[
"63aa7e0cd23d44b2",
"6160c5c434a8d971"
]
]
},
{
"id": "07c25d3586b3df20",
"type": "inject",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 330,
"y": 380,
"wires": [
[
"7bef089546e0e9f1"
]
]
},
{
"id": "ae713575410f0f70",
"type": "function",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "function 71",
"func": "var min = 20\nvar max = 25\nmin = Math.ceil(min);\n\nmsg.payload = Math.floor(Math.random() * (max - min)) + min;\nmsg.topic = \"living room\"\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 530,
"y": 440,
"wires": [
[
"63aa7e0cd23d44b2",
"6160c5c434a8d971"
]
]
},
{
"id": "999b10424ff13426",
"type": "inject",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "2",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 330,
"y": 440,
"wires": [
[
"ae713575410f0f70"
]
]
},
{
"id": "14fce2c960d1ad46",
"type": "inject",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "3",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 330,
"y": 500,
"wires": [
[
"2493f68ccd014154"
]
]
},
{
"id": "2493f68ccd014154",
"type": "function",
"z": "54882f66b0e8ee8e",
"g": "236fbb7ba3fbf945",
"name": "function 72",
"func": "var min = 25\nvar max = 30\nmin = Math.ceil(min);\n\nmsg.payload = Math.floor(Math.random() * (max - min)) + min;\nmsg.topic = \"kitchen\"\n\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 530,
"y": 500,
"wires": [
[
"63aa7e0cd23d44b2",
"6160c5c434a8d971"
]
]
},
{
"id": "ec6dc23a8a89c2f3",
"type": "ui-group",
"name": "My Group",
"page": "a33eb8dae09ca4b2",
"width": "12",
"height": "6",
"order": -1,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "a33eb8dae09ca4b2",
"type": "ui-page",
"name": "Page test ui-chart",
"ui": "a0a3f6b4e20a2ed7",
"path": "/pagetestUiChart",
"icon": "home",
"layout": "grid",
"theme": "1ad45fa8debfc5ba",
"order": -1,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "a0a3f6b4e20a2ed7",
"type": "ui-base",
"name": "my UI Base",
"path": "/dashboard",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control"
],
"showPathInSidebar": false
},
{
"id": "1ad45fa8debfc5ba",
"type": "ui-theme",
"name": "Default Theme",
"colors": {
"surface": "#ffffff",
"primary": "#0094ce",
"bgPage": "#eeeeee",
"groupBg": "#ffffff",
"groupOutline": "#cccccc"
},
"sizes": {
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "4px",
"widgetGap": "12px"
}
}
]