How Can I Pile up Data from server for Line chart?

Hello, Expert. I’m making some dynamic line chart.

For this, now I’m getting some data from serever, But It returns the one data at the specified time.

In other word. It get only one json object data.

So, For drawing line chart, I should pile the that data from server,

But I don’t know how should I pile up the received data from server.

In my thinking, I could implement that thing by using setInterval below.

setInterval(() => {
// Saving the formerdata in the “someLineChartID” as JSONArray Type.
// Getting the data from server.
// Add new data to formerData and This data is saved in newData
$$(“someLineChartID”).load(newData);
}, 5000);

However, I don’t know How can I get loaded data in the chart as JSONArray Type.

And If there is better way, Could you give me some advice?

Thx.

How can I get loaded data in the chart as JSONArray Type.

You can use chart.parse(array_of_data); or just use .add api like next

http://webix.com/snippet/ec7acd7a

Thanks maksim. It works very well!