jQuery.ajax({
type:"get",
url:"/value",
dataType:"json",
success: function(data) {for(var i=0;i
dataMoths.push(data.dateSet[i].month);
dataValue.push(data.dateSet[i].value);
}//alert(dataMoths);
$('#container').highcharts({
title: {
text:'Monthly Average Temperature',//标题
x: -20 //center 设置标题的位置
},
subtitle: {
text:'Source: WorldClimate.com', //副标题
x: -20 //副标题位置
},
credits:{//右下角的文本
enabled: false,
position: {//位置设置
align: 'right',
x:-10,
y:-10},
href:"http://www.highcharts.com",//点击文本时的链接
style: {
color:'blue'},
text:"Highcharts Demo"//显示的内容
},
xAxis: {//横轴的数据
categories: dataMoths
},
yAxis: {//纵轴的数据
title: {
text:'Temperature (°C)'},
plotLines: [{
value:0,
width:1,
}]
},
tooltip: {//鼠标移到图形上时显示的提示框
valueSuffix: '°C'},///*配置数据点选项*///plotOptions: {//spline: {//marker: {//enabled: false//}//},//line: {//dataLabels: {//enabled: false//},//enableMouseTracking: true//},//series: {//marker: {//enabled: false//}//}//},
legend: {
layout:'vertical',
align:'right',
verticalAlign:'middle',
enabled:false,//去掉右边的 name
borderWidth: 0},
series: [{
name:'London',
data:dataValue
}]
});
}
});
});