Filling stored data chart with real data

Hi to all, I need some support in order to populate with real data a chart filled with stored data. Firstly when the flow starts I populate the chart with the array coming from MySQL, and it works fine. Once it’s started I need to go on filling the chart with real data which are sent just like normal payload. But the chart refresh loosing the stored data. I tried several ways, using series, topic, key… but nothing.

Thanks a lot, I'll really appreciate any effort to help me.

You can't switch between those two was of data feeding into chart. What you can do, is store new data into database, get new portion of data (latest included, oldest removed) from database and feed it as historical data.

Errrr of course you can switch and add data. BUT the timestamps must be in range of whatever you have set the chart to display. Eg if set to show last hour then while you can load a chart showing an hour from yesterday, as soon as new data arrives that will get wiped as its more than an hour old.

BUT the timestamps...

Oh that was the issue when I tried to do it similar way. Silly me :smiley:

Thanks a lot guys, but I still have problems. The last stored data is continuosly connected to the last real data value. At the and, the last real value is always connected with a line to the previous real data and with another line with the last stored data.
Chart Flow

Deb1 Deb2

Deb3 Deb4

Just to complete my issue, as label it is shown only the "F", as you can see.
Finally, as following step I need to have two variables in the same chart. But I think this shouldn't be a big problem using the topic property, isnt'it?
this is the last code I'm trying after your suggestions

[{"id":"b87ea5cc.16fa88","type":"mysql","z":"8e3f4b3f.d74588","mydb":"a52b589c.b402b8","name":"MySQL","x":260,"y":240,"wires":[["3cf48631.ebfe5a","78380142.debb3"]]},{"id":"a52b589c.b402b8","type":"MySQLdatabase","z":"","host":"localhost","port":"3306","db":"Prova","tz":"2"}]