score:3

Accepted answer

Got it....

For complete code click here

var options = {
    chart: {
        renderTo: 'container',
        defaultSeriesType: 'spline'
    },
    series: [{name: 'A', data: [1,2,3,2,1]}]
};
var chart = new Highcharts.Chart(options);

$("#list").on('change', function(){
    //alert('f')
    var selVal = $("#list").val();
    if(selVal == "A" || selVal == '')
    {
        options.series = [{name: 'A', data: [1,2,3,2,1]}]
    }
    else if(selVal == "B")
    {
        options.series = [{name: 'B', data: [3,2,1,2,3]}]
    }
    else if(selVal == "C")
    {
        options.series = [{name: 'C', data: [5,4,8,7,6]}]
    } 
    else
    {
        options.series = [{name: 'D', data: [4,7,9,6,2]}]
    }  
    var chart = new Highcharts.Chart(options);    
});

score:1

in highcharts documentation you can fine a example for the same using a button,

example for series.setData(); http://api.highcharts.com/highcharts#Series.setData()

you can use the same example here also.

apply the same logic with on change event.


Related Query