最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Highcharts: StockChart initialization with new Highchart - Stack Overflow

programmeradmin0浏览0评论

I am trying to initalize a HighStock Chart. If I use this method:

var chart = new Highcharts.Chart('StockChart', dataObject);

I am getting an error that the rendering div cannot be found. If I use this method:

$('#container').highcharts('StockChart', dataObject);

The Chart is redered as expected. What I am doing wrong in the first method?

regards, Marko

Here is the fiddle: /

I am trying to initalize a HighStock Chart. If I use this method:

var chart = new Highcharts.Chart('StockChart', dataObject);

I am getting an error that the rendering div cannot be found. If I use this method:

$('#container').highcharts('StockChart', dataObject);

The Chart is redered as expected. What I am doing wrong in the first method?

regards, Marko

Here is the fiddle: http://jsfiddle/mkeuschn/K4Cj6/

Share Improve this question asked May 13, 2014 at 6:48 MarkoMarko 1,4012 gold badges22 silver badges38 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

If you create the chart like the first method, you have to delete the first parameter 'StockChart'. Heres the api: Highstock api

So, this should be the code:

var chart = new Highcharts.StockChart(dataObject);

Working fiddle: jsfiddle

发布评论

评论列表(0)

  1. 暂无评论