我正在尝试创建一个简单的股票图表,像这样 ,但它在控制台中引发了这个错误:
Uncaught TypeError: Cannot read property 'width' of undefined
Tick.getLabelSideshighstock.src.js:5338
Tick.handleOverflowhighstock.src.js:5360
Tick.renderhighstock.src.js:5573
(anonymous function)highstock.src.js:7491
eachhighstock.src.js:1021
Axis.renderhighstock.src.js:7473
Chart.render.chart.seriesGroup.renderer.g.attr.zIndexhighstock.src.js:10529
eachhighstock.src.js:1021
Chart.renderhighstock.src.js:10528
Chart.firstRenderhighstock.src.js:10729
Chart.inithighstock.src.js:10813
Charthighstock.src.js:9399
Highcharts.StockChart
为什么?我在想问题出在不正确的数据(或时间戳中的日期转换错误),但数据似乎是正确的。这是我正在使用的数据:
[[1343833881,1],[1343833879,-1],[1343833876,0],[1343833007,0],[1343833003,0],
[1343833000,-1],[1343832993,-1],[1343832993,1],[1343497396,0],[1343497340,0.5],
[1343497330,-1],[1343497316,-0.5]]
如果您在上面链接的高库存的 JSFiddle 示例中尝试此数据,您会发现它不起作用。