echarts修改柱状图/折线图网格线
修改splitLine属性,“show: true”为显示网格线,“show: flase”为隐藏网格线,lineStyle中color属性修改颜色。
option = {
xAxis: {
splitLine: {
show: true,
lineStyle: {
color: '#ff0000', // 竖向红色网格线
type: 'solid'
}
}
},
yAxis: {
splitLine: {
show: true,
lineStyle: {
color: '#00ff00', // 横向绿色网格线
type: 'solid'
}
}
},
series: [
{
// 示例系列数据
type: 'bar',
data: [220, 182, 191, 234, 290, 330, 310]
}
]
};

浙公网安备 33010602011771号