var highchartsOptions = { chart:{ renderTo:‘container‘ }, title:{ text:‘指标数据‘ }, tooltip:{ pointFormat:‘{series.name}:<b>{point.y}</b>‘ }, xAxis:{ categories:[] }, yAxis:{ title:{ text:‘数值‘ } }, series:[] };
/**
*categories:[]
*series:[
* {
* name:‘‘
* data:[]
* }
* ]
*/
function changeHighchartsOption(categories,series){
highchartsOptions.xAxis.categories = categories;
highchartsOptions.series = series;
newHighcharts(‘line‘);
}
function newHighcharts(type){
highchartsOptions.chart.type = type;
new Highcharts.Chart(highchartsOptions);
}
highcharts 多数据+切换,布布扣,bubuko.com
原文:http://www.cnblogs.com/xiaoxian1369/p/3892803.html