How to create a new Highstock chart with new Highc

2019-04-21 08:18发布

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.

1条回答
We Are One
2楼-- · 2019-04-21 09:01

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.

查看更多
登录 后发表回答