var piedom1 = document.getElementById(“echart1”);
var piedChart1 = echarts.init(piedom1);
pieoption1 = {
grid: {
top: ‘22%’,
left: ‘6%’,
right: ‘6%’,
bottom: ‘14%’,
},
legend: {
data: [‘电子信息制造业增加值当月增速(%)’, ‘电子信息制造业出口交货值当月增速(%)’],
left: ‘0’,
top: ‘0’,
textStyle: {
color: “#666666”,
padding: [0, 5],
fontSize: 12,
},
itemGap: 25
},
xAxis: [{
type: ‘category’,
boundaryGap: false,
axisLine: {
show: false,
},
axisLabel: {
textStyle: {
color: ‘#a0a7b1’,
fontSize: 12,
},
margin: 10
},
axisTick: {
show: false,
},
data: [’01’, ’02’, ’03’, ’04’, ’05’, ’06’, ’07’, ’08’, ’09’, ’10’, ’11’, ’12’],
}],
yAxis: [{
type: 'value',
axisTick: {
show: false,
},
max: 100,
splitLine: {
show: true,
lineStyle: {
color: '#f5f5f5',
width: 1
}
},
axisLine: {
lineStyle: {
color: '#f5f5f5',
},
},
axisLabel: {
textStyle: {
color: '#a0a7b1',
fontSize: 12
},
},
}, {
type: 'value',
axisTick: {
show: false,
},
max: 100,
position: 'right',
splitLine: {
show: true,
lineStyle: {
color: '#f5f5f5',
width: 1
}
},
axisLine: {
lineStyle: {
color: '#f5f5f5',
},
},
axisLabel: {
textStyle: {
color: '#a0a7b1',
fontSize: 12
},
},
}],
tooltip: {
trigger: 'axis',
showContent: false,
axisPointer: {
lineStyle: {
type: 'dashed',
}
}
},
series: [{
name: '电子信息制造业增加值当月增速(%)',
type: 'line',
smooth: true,
showSymbol: false,
symbolSize: 10,
itemStyle: {
normal: {
color: '#c52433',
borderColor: '#c52433',
borderWidth: 2,
lineStyle: {
color: '#c52433'
}
}
},
tooltip: {
show: true
},
areaStyle: { //区域填充样式
normal: {
//线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
color: "rgba(197,36,51,0.08)"
}
},
emphasis: {
itemStyle: {
color: {
type: 'radial',
x: 0.5,
y: 0.5,
r: 0.5,
colorStops: [{
offset: 0,
color: '#c52433'
},
{
offset: 0.4,
color: '#c52433'
},
{
offset: 0.5,
color: '#c52433'
}, {
offset: 0.7,
color: '#fff'
}, {
offset: 0.8,
color: '#fff'
}, {
offset: 1,
color: '#fff'
}
]
},
borderColor: '#c52433',
borderWidth: 1
}
},
data: [40, 22, 32, 48, 75, 30, 60, 80, 50, 43, 45, 40]
}, {
name: '电子信息制造业出口交货值当月增速(%)',
type: 'line',
smooth: true,
showSymbol: false,
symbolSize: 10,
itemStyle: {
normal: {
color: '#f4890b',
borderColor: '#f4890b',
borderWidth: 2,
lineStyle: {
color: '#f4890b'
}
}
},
tooltip: {
show: true
},
areaStyle: { //区域填充样式
normal: {
//线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
color: "rgba(244,137,11,0.08)"
}
},
emphasis: {
itemStyle: {
color: {
type: 'radial',
x: 0.5,
y: 0.5,
r: 0.5,
colorStops: [{
offset: 0,
color: '#f4890b'
},
{
offset: 0.4,
color: '#f4890b'
},
{
offset: 0.5,
color: '#f4890b'
}, {
offset: 0.7,
color: '#fff'
}, {
offset: 0.8,
color: '#fff'
}, {
offset: 1,
color: '#fff'
}
]
},
borderColor: '#f4890b',
borderWidth: 1
}
},
data: [25, 27, 35, 28, 55, 60, 40, 84, 46, 33, 25, 36]
}]
}
if (pieoption1 && typeof pieoption1 === “object”) {
piedChart1.clear();
piedChart1.resize();
piedChart1.setOption(pieoption1, true);
};