Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts Dynamic candlestick

I would like to make a dynamic chart with candlestick type , I tried to edit the dynamic example by add type: 'candlestick' to series but it doesn't work.

http://jsfiddle.net/hppyr/

like image 277
Mohamed Farrag Avatar asked Jan 26 '26 15:01

Mohamed Farrag


1 Answers

That is because you are passing line data to a candlestick OHLC needs its data as an array of array, with the each element on inner array having 5 values as [x,o,h,l,c]

series.addPoint([
    x,
    Math.random()*100,
    Math.random()*100,
    Math.random()*100,
    Math.random()*100
    ], true, true);


data.push([
    time + i * 1000,
    Math.random()*100,
    Math.random()*100,
    Math.random()*100,
    Math.random()*100
    ]);

API Reference @ http://api.highcharts.com/highstock#series.data jsFiddle @ http://jsfiddle.net/jugal/SykAf/

like image 128
Jugal Thakkar Avatar answered Jan 28 '26 06:01

Jugal Thakkar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!