Incubator-echarts: yAxis.splitLine.interval:function(idx,val){ }) 不执行

Created on 21 May 2016  ·  3Comments  ·  Source: apache/incubator-echarts

问题简述 (One-line summary)

文档中说明的 interval 参数无效
yAxis.splitLine.interval:function(idx,val){ }) 并不会执行。

另外还有个问题:设置 OPTION.TEXTSTYLE 似乎对文本样式不会产生任何影响

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version): 3.1.10
  • 浏览器类型和版本 (Browser version): 360/极速模式
  • 操作系统类型和版本 (OS Version):Windows7 sp1 64bit

    重现步骤 (Steps to reproduce)

1.
2.

期望结果 (Expected behaviour)

可能哪里有问题 (What went wrong)

ECharts配置项 (ECharts option)

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);

其他信息 (Other comments)

Most helpful comment

I would be better if echart support setting splitLine.interval for value axis also.

All 3 comments

数值轴不支持设置 splitLine.interval

I would be better if echart support setting splitLine.interval for value axis also.

的确有这样的需求。或者由其他替代方案吗?

Was this page helpful?
0 / 5 - 0 ratings