2013-11-22 77 views

回答

3

明白了....

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);  
}); 
+0

您好感謝這個例子中,在這裏,我來自未來的寫作=)感謝它爲我工作 –

+0

這工作geat。謝謝! – Ryan

相關問題