var Report = function(){
var xtitle = "";
var yAxisTitle = "比例 (单位 : %)";
var subxtitle = '来源 : ;
this.url = '/ps/coort!quour.action';
this.data = {};
this.ajax = function(){
$.ajax({
url: this.url,
data: this.data,
success : this.connectRateCharts
});
} //end ajax
this.connectRateCharts = function(data){
// alert(data);
chartData = eval("("+data+")");
chartData[2] = eval("["+chartData[2]+"]");
if(chartData[2]==""){
$.messager.alert('提示','无数据,请更换查询 。 ','info');
}
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'line',
marginRight: 50,
shadow : true,
marginBottom: 70
},
title: {
text: xtitle,
x: -20 //center
},
subtitle: {
text: subxtitle,
x: -20,
y: 35
},
xAxis: {
categories: chartData[0]
},
yAxis: {
title: {
text: yAxisTitle
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}],
allowDecimals:true
},
tooltip: {
enabled: false,
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +' : '+ this.y +'%';
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
legend: {
x: 0,
y: 0
},
series: [{
name: chartData[1],
data: chartData[2]
},{
name: "时间:" + chartData[3]
}]
}); //end chartData
}
//切换时间控件
this.checkDisplayTime = function(s){
}
}//end report
var report = new Report();
//初始加载
$('#startTime').val(nowDate);
$('#endTime').val(nowDate);
report.data = {
startTime:$('#startTime').val(),
endTime:$('#endTime').val(),
connectType:connectTypeValue
};
//初始加载
report.ajax();