简体   繁体   English

HighCharts:创建股票图表时出现奇怪的错误

[英]HighCharts: strange error from creation of stock chart

I'm trying to create a simple Stock Chart, like this but it throws this error in console: 我正在尝试创建一个像这样的简单股票图表,但是它将在控制台中引发以下错误:

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

Why? 为什么? I was thinking that the problem is from incorrect data (or bad conversions of date in timestamp), but the data seems to be correct. 我以为问题出在不正确的数据(或时间戳中日期的错误转换),但数据似乎是正确的。 Here's the data I'm using: 这是我正在使用的数据:

[[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]]

If you try this data in the JSFiddle example of high stock linked above you will see that it doesn't work. 如果您在上面链接的JSFiddle高库存示例中尝试此数据,您将发现它不起作用。

i have the same problem, but in mi case I have a file named jquery.resize.js, this was the error, because it search the property for your purpose, i remove the link to the file and it works nice. 我有同样的问题,但在mi情况下,我有一个名为jquery.resize.js的文件,这是错误的,因为它会根据您的目的搜索属性,因此我删除了指向该文件的链接,并且效果很好。

I hope it helps! 希望对您有所帮助!

Kind regards. 亲切的问候。

您的时间值是按降序排列的,而它们需要严格按升序排列,请在此处找到具有相同数据的图表,只需正确排序即可, http://jsfiddle.net/jugal/Swj3E/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM