我正在尝试实现与此非常相似的内容:
我就像这样设置我的数据,
for (i; i < dataLength; i += 1) {
ohlc.push([
data[i][0], // the date
data[i][1], // open
data[i][2], // high
data[i][3], // low
data[i][4] // close
]);
volume.push([
data[i][0], // the date
data[i][5] // the volume
]);
}
this.chartOptions.series[0]['data'] = ohlc;
this.chartOptions.series[1]['data'] = volume;
但是我遇到了这个错误:
core.js:4352 ERROR TypeError: Cannot read property 'length' of undefined
at B.arrayMax (highstock.js:19)
at x.translate (volume-by-price.js:16)
at x.redraw (highstock.js:417)
at highstock.js:330
at Array.forEach (<anonymous>)
at n.redraw (highstock.js:330)
at n.update (highstock.js:442)
at HighchartsChartComponent.updateOrCreateChart (highcharts-angular.js:35)
at HighchartsChartComponent.wrappedUpdateOrCreateChart (highcharts-angular.js:30)
at HighchartsChartComponent.ngOnChanges (highcharts-angular.js:17)