Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/417.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Highcharts动态烛台_Javascript_Jquery_Highcharts - Fatal编程技术网

Javascript Highcharts动态烛台

Javascript Highcharts动态烛台,javascript,jquery,highcharts,Javascript,Jquery,Highcharts,我想用candlesticktype制作一个动态图表,我试图通过将type:'candlestick'添加到系列中来编辑动态示例,但它不起作用 这是因为您正在将行数据传递给烛台 OHLC需要将其数据作为数组的一个数组,内部数组中的每个元素都有5个值 [x,o,h,l,c] series.addPoint([ x, Math.random()*100, Math.random()*100, Math.random()*100, Math.random()*1

我想用
candlestick
type制作一个动态图表,我试图通过将
type:'candlestick'
添加到系列中来编辑动态示例,但它不起作用


这是因为您正在将行数据传递给烛台 OHLC需要将其数据作为数组的一个数组,内部数组中的每个元素都有5个值
[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参考@ jsFiddle@