echart中折线图中有默认的网格如何去除呢?
原图如下
附上代码
var myChart = echarts.init(document.getElementById('main'));
option = {
title: {
text: '折线图堆叠'
},
grid: {
show:false
},
tooltip: {
trigger: 'axis'
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['14:00','15:00','16:00','17:00','18:00','19:00','20:00']
},
yAxis: {
type: 'value',
},
series: [
{
name:'搜索引擎',
type:'line',
areaStyle: {normal: {color:'#87CEFA'}},
data:[488, 932, 1100, 1500, 1702, 2045, 2244]
}
]
};
myChart.setOption(option);
去除后的图如下
只要在对应的Axis中的属性splitLine设置show:false即可
完整代码
var myChart = echarts.init(document.getElementById('main'));
option = {
title: {
text: '折线图堆叠'
},
grid: {
show:false
},
tooltip: {
trigger: 'axis'
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['14:00','15:00','16:00','17:00','18:00','19:00','20:00'],
//splitLine:{
//show:false
//}
},
yAxis: {
type: 'value',
splitLine:{
show:false
},
},
series: [
{
name:'搜索引擎',
type:'line',
areaStyle: {normal: {color:'#87CEFA'}},
data:[488, 932, 1100, 1500, 1702, 2045, 2244]
}
]
};
myChart.setOption(option);