Display datas from influx in an UI-Chart

I want to display data from an influxdb in a linechart. The data comes from the database as follows.
I then attached a changenode and after that the data looks like this. I can't get the data to display in the linechart.

after change-node

This (which is linked from the chart help text) shows you how to format the data for the chart.

I know the help text, but it does not help me.
I just want to draw a line.
I have the difficulty that I do not get the data from the array displayed. The array contains the temperature values for 24 hours. Every 5 minutes the value is written to the Influxdb.

Does the format of the data you are supplying match that specified in the docs?

[Edit] Are you trying to fill the chart with data from the database, or are you trying to draw a line with data in real time as it is fetched from the sensor?

I want to draw the lines with data from the database. I get the live data from the sensor displayed.

Ok, so consider the first question in my last post.

No, because i have an array in the payload.

So is your question not how to display data from influx, but how to reformat this array of data into a different structure?

Yes that is my question

Well in order for you do achieve the reformat first read the node red docs page on Working with Messages. Then you need to write down in words what you need to do. So you might start with
Construct an object containing the following properties: ...
Once you have done that then you may be able to do it. If not then come back again and tell us which bit you are having difficulty with.

Did I understand correctly that it could work like this.
In the array are the two objects 0 and 1.
0 contains the time of the measured value
1 contains the measured value
0 I would have to rename to timestamp and specify the time in milliseconds.
1 would have to be renamed to payload and contain the measurement value. Then the linechart would be drawn correctly.

You can also insert extra data points by specifying the timestamp property. This must be in either epoch time (in miliseconds, not seconds), or ISO8601 format.

{topic:"temperature", payload:22, timestamp:1520527095000}

No, you are looking at the section for live data. You need the section I linked to, which is the section headed Stored Data. node-red-dashboard/Charts.md at master · node-red/node-red-dashboard · GitHub

Thank you for your support so far.
I have now made further progress. But I have not quite made it and need your support again
I have marked the two places in the screenshot.
1 marks the place how it should look and 2 shows the place how it looks. I have not yet managed to make an array out of the object.
I was able to add the arrays Series and Labels.
Bildschirmfoto 2021-01-10 um 13.36.14

Show me how you are doing that.

1 Like

I'm also interested to see the result since I trying to parse the data from a influxDB response to a UI chart. My data looks like this

Capture

Have you looked at the link posted to see the format required?

I do the whole thing with a change node. See screen shot.
I have also attached a screen-shot of the data from the Influxdb.

raw

Can you show me how you convert the time format (RFC3339) output from influxdb to a time format valid for the ui_chart node.

@nicobauer looking at the data from the database you need to change all the You need to change all the data points to use x: and y:, currently each data point is an array. I would do that in a function node using the map function, something like
msg.payload = msg.payload.map(point => {x: point[0], y:point[1]})
Try that and check that it does what is intended. Once that is working then you need to build the whole object, something like
msg.payload = [{ series: ["my series name"], data: [msg.payload], labels: [""]}]
I haven't tested that as I don't have your data, but if it doesn't work then show me the function and what is coming out of the function (or what the error is if it won't run).

The chart should accept timestamps from influx (if you are using the Influxdb In node at least) without modification. If it isn't working for you show me what you are feeding to the chart.