效果:
代码:
this.myChart1.setOption({
grid: {
top: '8%',
bottom: '12%',
left: '5%',
right: '4%',
},
xAxis: {
type: 'category',
// data: xData,
boundaryGap: false,
axisLine: {
show: true,
lineStyle: {
color: "#fff",
width: 0,
type: "solid"
},
},
axisLabel: {
textStyle: {
color: "#8C8C8C",
},
},
},
yAxis: {
type: 'value',
axisLine: {
show: true,
lineStyle: {
color: "#F0F0F0",
width: 1,
type: "solid",
},
},
axisLabel: {
textStyle: {
color: "#8C8C8C",
},
},
splitLine: {
show:true,
lineStyle: {
color: "#5B6684",
}
}
},
series: [
{
name: 'line1',
data: data,
type: 'line',
itemStyle: {
normal: {
color: '#FF5656',
opacity: 1,
}
}
}
]
})