Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a new Highstock chart with new Highchart and not jquery?

All the examples on the Highchart website creates a stockchart using:

$('#container').highchart('Stockchart', config);

How do I create a stock chart by simply using new? eg:

var chart = new Highchart('Stockchart', config)

I tried that, and this...

var chart = new HighStock(config)

...with no luck.

like image 624
kidcapital Avatar asked Apr 17 '13 22:04

kidcapital


1 Answers

I googled more and eventually found it.
To do it you code like this:

chart = new Highcharts.StockChart(config)

Annoying that they say that... anyway yeah, it has two constructors, Highcharts.Chart and Highcharts.StockChart.

like image 200
kidcapital Avatar answered Sep 23 '22 20:09

kidcapital