Configuring node chart

HI, I am new here.
I am using V4.1.3 of NodeRed. I have followed several tutorials, demos, forums about the use of the chart node. (Dashboard-2 - Chart)
If I use the node with real time data fed in, all works well. Auto scaling, nice look.
The next step was getting data from an SQL database and using two fields - Time and Value - plot a chart with that. Seems easy enough. But I get an empty chart. It sets the series, the X and Y labels for the axes, all escept the data.
The data that is currently being sent in can be seen in the debug node as: [{"series":["CPU"],"data":[[{"x":1766988181000,"y":12.3}],[{"x":1766989181000,"y":12.3}],[{"x":1766990181000,"y":12.3}]],"labels":["txtt"]}]

I also took two screenshots of the configuration of the Chart node


Please tell me what I am doing wrong. Have tried multiple combinations of options, data formats etc and still nothing.
Thank you

One more detail


, the small flow example I am using

Welcome to the forum @jmab1955.

The sample data you have shown seems to be in an odd format, I'm not surprised you don't get any output in the dashboard.
Also it seems to contain just 3 identical (x,y) points so it won't ever draw much of a line on the chart.

I am guessing that you are migrating a chart from the original dashboard, or at least you started off with a dashboard 1 tutorial.

Can you share the SQL you used to get this data?

Hi JBudd, thanks for the answer.
The answers I need I actually connected to what you said:

  • the data format. What I have in the example is a set created manually, and as you say based on data from online forums and examples. This is it in another format. You can notice that although the value is always the same the time has 3 different values.
  • [ { "series": "CPU"],
    "data": [ [ {
    "x": 1766988181000,
    "y": 12.3
    } ],
    [ {
    "x": 1766989181000,
    "y": 12.3
    } ],
    [ {
    "x": 1766990181000,
    "y": 12.3
    }]
    ],
    "labels": ["txtt"]
    }
    ]

I do have larger sets of data that come out of SQL, but I want to get my basics working first. I f I do not plot 3 points, I do not need to try 500...
So if you, or another kind reader, can send an example of HOW it should be it would be great.

  • the second point is the analysis of what is in the screenshots of the configuration. my major doubts are around the "properties" area just above the colors selection. This somehow must be compatible with the message coming in.

Any possibility of sending me an example of a simple plot like this one tat works?

Thank you !

Yes you are right, I'm afraid I only looked at the seconds and milliseconds bit and assumed they were identical.

Yes, why not?

image

[{"id":"52f260250a409ad4","type":"inject","z":"e3e44c2c66857cbf","g":"203747e9378668ca","name":"SQL","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"select created, mainsvoltage from sensordata where mainsvoltage is not null order by id desc limit 5","payload":"","payloadType":"date","x":110,"y":1000,"wires":[["ba2cd018bdfdedd8"]]},{"id":"ba2cd018bdfdedd8","type":"link call","z":"e3e44c2c66857cbf","g":"203747e9378668ca","name":"DB","links":["864559a5caeb4a28"],"linkType":"static","timeout":"30","x":250,"y":1000,"wires":[["abd537c643fa472c"]]},{"id":"abd537c643fa472c","type":"ui-chart","z":"e3e44c2c66857cbf","g":"203747e9378668ca","group":"bf3d065c8f9a2c73","name":"","label":"Mains voltage","order":2,"chartType":"line","category":"Voltage","categoryType":"str","xAxisLabel":"","xAxisProperty":"created","xAxisPropertyType":"property","xAxisType":"time","xAxisFormat":"","xAxisFormatType":"auto","xmin":"","xmax":"","yAxisLabel":"","yAxisProperty":"mainsvoltage","yAxisPropertyType":"property","ymin":"180","ymax":"260","bins":10,"action":"replace","stackSeries":false,"pointShape":"false","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":"8","height":8,"className":"red","interpolation":"step","x":420,"y":1000,"wires":[[]]},{"id":"bf3d065c8f9a2c73","type":"ui-group","name":"Chart","page":"3d714c1c4caec402","width":"8","height":1,"order":1,"showTitle":false,"className":"","visible":"true","disabled":"false","groupType":"default"},{"id":"3d714c1c4caec402","type":"ui-page","name":"Octopus Consumption","ui":"a3e614cd9df4ae2e","path":"/octopus","icon":"home","layout":"grid","theme":"0d92c765bfad87e6","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":"a3e614cd9df4ae2e","type":"ui-base","name":"My Dashboard","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control"],"showPathInSidebar":false,"navigationStyle":"default","titleBarStyle":"default"},{"id":"0d92c765bfad87e6","type":"ui-theme","name":"Basic Blue Theme","colors":{"surface":"#4d58ff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}},{"id":"3a500093dc6716c8","type":"global-config","env":[],"modules":{"@flowfuse/node-red-dashboard":"1.30.2"}}]

Although you don't have my database I included my MariaDB SQL statement so that you can see how straightforward it is to get from a query to a chart with no jiggery-pokery in between.

This is the output from the query

[{"created":"2026-02-07T15:30:00.000Z","mainsvoltage":229},{"created":"2026-02-07T15:15:02.000Z","mainsvoltage":225},{"created":"2026-02-07T15:00:00.000Z","mainsvoltage":231},{"created":"2026-02-07T14:45:02.000Z","mainsvoltage":228},{"created":"2026-02-07T14:30:00.000Z","mainsvoltage":229}]

If you had shared your query as requested my response could have been tailored to your db structure rather than mine ...

Thank you again !
Before I saw your last post there was an important bit of info in your previous post that I had overlooked !
The Dashboard versions ... I am using the most recent Flowfuse and the examples I was using were from the NodeRed version.
Corrected that, the samples worked and then using the database data was straight forward!

Thank you again! I had spent (or lost) a few days banging at this.
Here is the result.


Needs some retouch but the main issue is solved!

Regards

1 Like