cmeer
Posts: 1
Joined: Fri Oct 08, 2021 4:02 pm

I cant update my candle chart with new data

Hello all,

I am trying to update my candle chart but i cant get it to work.

I want to do two things:
1: update/edit the prices of the last candle.
2: add a new candle.

I found a few examples of a candlechart being updated but when i try to implement it into my chart it does not work.
For example series.data was empty.

I try to do it via a set interval within the chart code. But later i want to receive a update via websocket and with that data update the chart.
On the top of the code is an example how i receive my data. That part works.

I hope someone can point me in the right direction.

This is my chart:
http://jsfiddle.net/mv5o6t47/3/

This is the example i had seen:
http://jsfiddle.net/m2P5a/
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: I cant update my candle chart with new data

Hello cmeer,

Welcome to our forum and thanks for contacting us with your question!

Unfortunatelly it is not possible to update single point when data grouping is enabled. It is because you simply cannot reference single raw point. It works in the example that you shared because points aren't grouped.

When it comes to adding a new candle you can use addPoint method to add a new point for a selected series.
Demo: http://jsfiddle.net/BlackLabel/2gvtbhk6/
API reference: https://api.highcharts.com/class-refere ... s#addPoint

Let me know if you have any further questions!
Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Stock”