文档中说明的 interval 参数无效
yAxis.splitLine.interval:function(idx,val){ }) 并不会执行。
另外还有个问题:设置 OPTION.TEXTSTYLE 似乎对文本样式不会产生任何影响
1.
2.
var myChart = echarts.init(document.getElementById('main'));
//模拟数据
var data = [];
var time = [];
var data = [];
var data2 = [];
for(var i= 0;i<=72;i++)
{
time.push(i);
data.push( Math.round((Math.random()*100)*1000));
data2.push( Math.round((Math.random()*100)*200));
}
//
option = {
yAxis: {
type: 'value',
position:'left',
max:100000,
splitLine:{interval:function(idx1,val1){
//疑问点,yAxis.splitLine.interval 貌似并不执行
console.log(idx1);
return true;
}},
axisLine:{show:false} ,
axisTick:{show:false},
},
xAxis: {
type: 'category',
boundaryGap: false,
data: time,
axisLabel:{ margin:20,textStyle:{ color:'#7a8a9a'}},
},
series:
[
{
type:'line',
data: data
},
{
type:'line',
data: data2
}
]
};
myChart.setOption(option);
数值轴不支持设置 splitLine.interval
I would be better if echart support setting splitLine.interval for value axis also.
的确有这样的需求。或者由其他替代方案吗?
Most helpful comment
I would be better if echart support setting splitLine.interval for value axis also.