Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts: StockChart initialization with new Highchart

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.net/mkeuschn/K4Cj6/

like image 529
Marko Avatar asked Mar 20 '23 15:03

Marko


1 Answers

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

like image 181
ZerOne Avatar answered Apr 02 '23 12:04

ZerOne