Accepted answer

i see three questions in your case:

1) to get object when creating chart, you have two ways:

  • with jquery:

    var chart = $(element).highcharts('stockchart', options).highcharts();
  • without jquery:

    var chart = new highcharts.stockchart(options);

2) error #17:

"the requested series type does not exist"

is caused by type : 'stockchart'. type is reserved for a series type. as @raeen hashemi said, to create highstock, use different constructor: new highcharts.stockchart(options).

3) yes, you can pass an object to renderto:

new highcharts.stockchart({
    chart: {
        renderto: document.getelementsbyclassname("container")[0] 

    series: [{
        name: 'usd to eur',
        data: [10, 20]

4) this - honestly, i'm not sure why you need access to this somewhere else than event handlers. instead use highcharts.charts[index] or stored variables like chart or $(element).highcharts()


for es6, use it in below method.

import * as highcharts from "highcharts";
import * as highchartstree from 'highcharts/modules/treemap';

also, any highchart type can be added instead of treemap


Related Query

More Query from same tag