Creating a chart with custom X-axis values in Node-RED Dashboard using the "chart" node.

Hello,
I have a problem creating a chart in Node-RED's Dashboard using the "chart" node. I would like to display values on the X-axis other than just the system time. Currently, when using the "chart" node, the chart only shows measurements based on the system time. Is there any way to add other values to the X-axis, such as those retrieved from a JSON object?

For a single line, non time series line chart, the payload should be

[{
    "series": ["X" ],
    "data": [ [5,6,9,10] ],
    "labels": [ "Jan", "Feb", "Mar", "Apr" ]
}]

Where labels is the x data values

More info from link in help text

here is another example

[{"id":"d712fdf32a0a4925","type":"ui_button","z":"a0eee751005e0e89","name":"","group":"8c63781ab95a5a94","order":1,"width":"3","height":"1","passthru":false,"label":"Load Data","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"[{\"series\":[\"X\",\"Y\"],\"data\":[[5,6,9,10],[3,8,5,11]],\"labels\":[\"Jan\",\"Feb\",\"Mar\",\"Apr\"]}]","payloadType":"json","topic":"topic","topicType":"msg","x":1880,"y":2340,"wires":[["38aef9b45e99c257"]]},{"id":"38aef9b45e99c257","type":"ui_chart","z":"a0eee751005e0e89","name":"Bar Chart","group":"8c63781ab95a5a94","order":2,"width":"20","height":"9","label":"{{mname}}","chartType":"bar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":2220,"y":2340,"wires":[[]]},{"id":"8c63781ab95a5a94","type":"ui_group","name":"Group 2","tab":"4f903fa3c7ed98d8","order":2,"disp":true,"width":"20","collapse":false,"className":""},{"id":"4f903fa3c7ed98d8","type":"ui_tab","name":"Dashboard2","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.