I want two y-axis. Thats my code but it is not working.
[
{
"id": "4d42c82f441208c2",
"type": "inject",
"z": "6358dcd8731b6b68",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "1200",
"crontab": "",
"once": false,
"onceDelay": "1",
"topic": "",
"payload": "",
"payloadType": "date",
"x": 270,
"y": 2120,
"wires": [
[
"2a3df72899b75e5d"
]
]
},
{
"id": "2a3df72899b75e5d",
"type": "function",
"z": "6358dcd8731b6b68",
"name": "Abfrage der Werte",
"func": "// Hole die Werte aus der globalen Variable\nlet leistung = global.get(\"Leistung\") || 0;\nlet temperatur = global.get(\"temperatur_Zelt\") || 0;\n\n// Konfiguriere das Diagramm mit zwei Y-Achsen\nlet ui_control = {\n \"options\": {\n \"scales\": {\n \"yAxes\": [\n {\n \"id\": \"y-axis-1\",\n \"type\": \"linear\",\n \"position\": \"left\",\n \"scaleLabel\": { \"display\": true, \"labelString\": \"Leistung (Watt)\" }\n },\n {\n \"id\": \"y-axis-2\",\n \"type\": \"linear\",\n \"position\": \"right\",\n \"scaleLabel\": { \"display\": true, \"labelString\": \"Temperatur (°C)\" }\n }\n ]\n }\n }\n};\n\n// Sende die Werte als einzelne Nachrichten mit zugewiesener Achse\nlet msgs = [\n { topic: \"Leistung\", payload: leistung, ui_control, yAxisID: \"y-axis-1\" },\n { topic: \"Temperatur\", payload: temperatur, ui_control, yAxisID: \"y-axis-2\" }\n];\n\n// Mehrere Nachrichten senden\nreturn [msgs];\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 550,
"y": 2120,
"wires": [
[
"0338ca703a132da7",
"ffd716f710613851"
]
]
},
{
"id": "0338ca703a132da7",
"type": "ui-chart",
"z": "6358dcd8731b6b68",
"group": "2a8e39cac6fe4bb9",
"name": "Leistung und Temperatur",
"label": "Leistung und Temperatur",
"order": 4,
"chartType": "line",
"category": "topic",
"categoryType": "msg",
"xAxisLabel": "",
"xAxisProperty": "",
"xAxisPropertyType": "timestamp",
"xAxisType": "time",
"xAxisFormat": "",
"xAxisFormatType": "auto",
"xmin": "",
"xmax": "",
"yAxisLabel": "",
"yAxisProperty": "payload",
"yAxisPropertyType": "msg",
"ymin": "",
"ymax": "",
"bins": 10,
"action": "append",
"stackSeries": false,
"pointShape": "circle",
"pointRadius": 4,
"showLegend": true,
"removeOlder": 1,
"removeOlderUnit": "3600",
"removeOlderPoints": "",
"colors": [
"#0095ff",
"#ff0000",
"#ff7f0e",
"#2ca02c",
"#a347e1",
"#d62728",
"#ff9896",
"#9467bd",
"#c5b0d5"
],
"textColor": [
"#666666"
],
"textColorDefault": true,
"gridColor": [
"#e5e5e5"
],
"gridColorDefault": true,
"width": 6,
"height": 8,
"className": "",
"interpolation": "linear",
"x": 850,
"y": 2120,
"wires": [
[]
]
},
{
"id": "ffd716f710613851",
"type": "debug",
"z": "6358dcd8731b6b68",
"name": "debug 7",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 740,
"y": 2220,
"wires": []
},
{
"id": "2a8e39cac6fe4bb9",
"type": "ui-group",
"name": "Microgreens Zelt",
"page": "8e53903ac41b05c6",
"width": "8",
"height": "4",
"order": 1,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "default"
},
{
"id": "8e53903ac41b05c6",
"type": "ui-page",
"name": "Microgreens Zelt",
"ui": "29b53658faf575c1",
"path": "/page1",
"icon": "home",
"layout": "grid",
"theme": "622486944d7f9c5e",
"breakpoints": [
{
"name": "Default",
"px": "0",
"cols": "3"
},
{
"name": "Tablet",
"px": "576",
"cols": "6"
},
{
"name": "Small Desktop",
"px": "768",
"cols": "9"
},
{
"name": "Desktop",
"px": "1024",
"cols": "12"
}
],
"order": 1,
"className": "",
"visible": true,
"disabled": false
},
{
"id": "29b53658faf575c1",
"type": "ui-base",
"name": "My Dashboard",
"path": "/dashboard",
"appIcon": "",
"includeClientData": true,
"acceptsClientConfig": [
"ui-notification",
"ui-control",
"ui-scheduler"
],
"showPathInSidebar": false,
"headerContent": "page",
"navigationStyle": "default",
"titleBarStyle": "default",
"showReconnectNotification": true,
"notificationDisplayTime": 1,
"showDisconnectNotification": true
},
{
"id": "622486944d7f9c5e",
"type": "ui-theme",
"name": "Default Theme",
"colors": {
"surface": "#ffffff",
"primary": "#0094CE",
"bgPage": "#eeeeee",
"groupBg": "#ffffff",
"groupOutline": "#cccccc"
},
"sizes": {
"density": "default",
"pagePadding": "12px",
"groupGap": "12px",
"groupBorderRadius": "4px",
"widgetGap": "12px"
}
}
]