Charting of future data

Hi,

I want to chart weather predictions, that are obviously in the future. The actual data are in the payload property. I have a property dt where the timestamp (in the future) belonging to these data is. The chart node normally plots the data vs the timestamp of the message. According to the info with Dashboard it should be possible to add a timestamp property to the message and set this to the desired value. I did this but the chart keeps on showing the data vs the timestamp of the message that is fed into the chart node.

Apparently the feature does not work.

Can anyone be of help?

Most probably you will find the way from here: https://github.com/node-red/node-red-dashboard/blob/master/Charts.md
Section “Stored data” is specially useful.

1 Like

Thanks! I will probably try that.

I tried to use the method described under Line Charts in the same article. I stil hope that someone can shed a light on that method, as it will take less effort

As the document says:

> You will need to process your data into this structure in order to render it correctly.

Share your flow or the function where you construct the data for chart. It’s very hard to figure out where the problem lays without knowing about your data structure and stuff…

I tried to make life easy. I imported the flow with examples on the bottom of the article. The way of working is pretty clear from the function nodes in the flow, where the data structures are created. However, none of the chart types give any results.

The only thing that I see, when pressing the knobs in the dashboard window, is that the “No Data” dissappears from some of the chart areas. But further no point or lines visible.

I use Nodered 0.17.2. I’m now going to import the example flow in version 0.18.3 …

That’s it ! In NR 0.18.3 the examples show very nice results. I have a load of examples to learn from now.

The exact structure of the chart object is inside function nodes.

Thanks for your help!

(I will also check if the simple addition of a timestamp field with the future time works in NR 0.18.3. and post the result over here)

Also the option with simple addition of a timestamp field works in V0.18.3 !

So: all options mentioned in the github page work, provided that I use a recent version of Nodered.

Very very nice :wink:

In case anyone stumbles across this thread in the future. Here is an example using the DarkSky API for weather data.

You can use the following JSONata expression to create a chart showing the next 24hrs of forecast precipitation & probability.

[{
    "series": ["Intensity","Probability"],
    "data": [ 
        [ payload.hourly.data.{"x":time*1000,"y":precipIntensity} ],
        [ payload.hourly.data.{"x":time*1000,"y":precipProbability} ] 
    ],
    "labels": []
}]
2 Likes