option = {
tooltip : {
trigger:'item',
showDelay: 0,
show:true,
hideDelay: 50,
transitionDuration:0,
backgroundColor : 'red',
borderColor : '#f50',
borderRadius : 8,
borderWidth: 2,
padding: 10,
formatter: function (params, ticket, callback) {
$.get('detail?name=' + params.name, function (content) {
callback(ticket, toHTML(content));
});
return params.data.name + '->' + params.data.value;
},
position : function(p) {
return [p[0] + 10, p[1] - 10];
}
},
title: {
text: '一天用电量分布',
subtext: '纯属虚构'
},
toolbox: {
show: true,
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['第一天', '第二天', '第二天', '03:45', '05:00', '06:15', '07:30', '08:45', '10:00', '11:15', '12:30', '13:45', '15:00', '16:15', '17:30', '18:45', '20:00', '21:15', '22:30', '23:45']
},
yAxis: {
type: 'value'
},
visualMap: {
show: false,
dimension: 0,
pieces: [{
lte: 6,
color: 'green'
}, {
gt: 6,
lte: 8,
color: 'red'
}, {
gt: 8,
lte: 14,
color: 'green'
}, {
gt: 14,
lte: 17,
color: 'red'
}, {
gt: 17,
color: 'green'
}]
},
series: [
{
name:'日期',
type:'line',
smooth: true,
data: [{name:'2016年12月12日', value:300}, {name:'2016年12月13日', value:280}, {name:'2016年12月14日', value:340}, 260, 270, 300, 550, 500, 400, 390, 380, 390, 400, 500, 600, 750, 800, 700, 600, 400],
markArea: {
data: [ [{
name: '早高峰',
xAxis: '07:30'
}, {
xAxis: '10:00'
}], [{
name: '2016年12月12日',
xAxis: '17:30'
}, {
xAxis: '21:15'
}] ]
}
}
]
};
tooltip : {
trigger:'item',
showDelay: 0,
show:true,
hideDelay: 50,
transitionDuration:0,
backgroundColor : 'red',
borderColor : '#f50',
borderRadius : 8,
borderWidth: 2,
padding: 10,
formatter: function (params, ticket, callback) {
$.get('detail?name=' + params.name, function (content) {
callback(ticket, toHTML(content));
});
return params.data.name + '->' + params.data.value;
},
position : function(p) {
return [p[0] + 10, p[1] - 10];
}
},
title: {
text: '一天用电量分布',
subtext: '纯属虚构'
},
toolbox: {
show: true,
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['第一天', '第二天', '第二天', '03:45', '05:00', '06:15', '07:30', '08:45', '10:00', '11:15', '12:30', '13:45', '15:00', '16:15', '17:30', '18:45', '20:00', '21:15', '22:30', '23:45']
},
yAxis: {
type: 'value'
},
visualMap: {
show: false,
dimension: 0,
pieces: [{
lte: 6,
color: 'green'
}, {
gt: 6,
lte: 8,
color: 'red'
}, {
gt: 8,
lte: 14,
color: 'green'
}, {
gt: 14,
lte: 17,
color: 'red'
}, {
gt: 17,
color: 'green'
}]
},
series: [
{
name:'日期',
type:'line',
smooth: true,
data: [{name:'2016年12月12日', value:300}, {name:'2016年12月13日', value:280}, {name:'2016年12月14日', value:340}, 260, 270, 300, 550, 500, 400, 390, 380, 390, 400, 500, 600, 750, 800, 700, 600, 400],
markArea: {
data: [ [{
name: '早高峰',
xAxis: '07:30'
}, {
xAxis: '10:00'
}], [{
name: '2016年12月12日',
xAxis: '17:30'
}, {
xAxis: '21:15'
}] ]
}
}
]
};