score:18

Accepted answer

Yes you can. See their example here: http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/chart/renderto-jquery/

basically you assign an jQuery element to a variable:

renderTo: $('.myclass')[0]

score:14

As Ido already said, you can't have multiple ids, but you can have multiple classes.

I had to do the following:

var $containers = $('.container'),
    chartConfig = {
        chart: {
            renderTo: null,
            defaultSeriesType: 'column'
        }
    };

$containers.each(function(i, e){
    chartConfig.chart.renderTo = e;
    new Highcharts.Chart(chartConfig);
});

Also, you don't really have to assign the Chart object to a variable - at least I didn't want to.

Hope it helps somebody.


Related Query

More Query from same tag