配置项如下
var datax=[1950,1951,1952];
options =
[
option1={
series: [{
type: 'map3D',
map: 'china',
label: {
show: 'true',
textStyle: {
fontSize: 5,
borderWidth: 0
},
distance: 0
},
itemStyle: {
borderWidth: 0.3,
borderColor: '#fff',
}
}],
backgroundColor:'#000'
},
option2={
title: {
text: '一天用电量分布',
subtext: '纯属虚构'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
toolbox: {
show: true,
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: datax
},
yAxis: {
type: 'value',
axisLabel: {
formatter: '{value} W'
},
axisPointer: {
snap: true
}
},
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: [20,30,40],
markArea: {
data: [ [{
name: '早高峰',
xAxis: '07:30'
}, {
xAxis: '10:00'
}], [{
name: '晚高峰',
xAxis: '17:30'
}, {
xAxis: '21:15'
}] ]
}
}
]
}
];