Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echarts 3 设置min、minInterval无法同时生效。 #4838

Closed
luoway opened this issue Jan 2, 2017 · 3 comments
Closed

echarts 3 设置min、minInterval无法同时生效。 #4838

luoway opened this issue Jan 2, 2017 · 3 comments

Comments

@luoway
Copy link

luoway commented Jan 2, 2017

One-line summary [问题简述]

期望Y轴刻度值最小值为0,最小间隔为1。实际设置min后minInterval失效,在数据全0时最小刻度为小数。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.3.2
  • Browser version [浏览器类型和版本]:chrome 55.0.2883.95
  • OS Version [操作系统类型和版本]:Mac OS

Expected behaviour [期望结果]

Y轴刻度值最小值为0,最小间隔为1

ECharts option [ECharts配置项]

option = {
    yAxis : [
    	{
            type : 'value',
            axisLine:{
                lineStyle:{
                	color: 'transparent'
                }
            },
            minInterval:1,
            min: 0
     	}
     ],
}

相同问题

#4665

@luoway
Copy link
Author

luoway commented Feb 7, 2017

解决方案:
条件判断,当输入数据小于一定值时设置固定刻度interval,大于一定值时不设置固定刻度。
所以minInterval无效,别用

@luoway luoway closed this as completed Feb 7, 2017
@finalion
Copy link

问题仍然存在,还没解决?

100pah added a commit that referenced this issue Apr 22, 2017
@ginkosen
Copy link

ginkosen commented May 13, 2017

版本3.5.4这个问题依然存在。

使用官方案例配置如下

app.title = '坐标轴刻度与标签对齐';

option = {
    color: ['#3398DB'],
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器,坐标轴触发有效
            type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
            axisTick: {
                alignWithLabel: true
            }
        }
    ],
    yAxis : [
        {
            type: "value",
            axisLine: {
              show: false,
              onZero: false
            },
            axisTick: {
              show: false
            },
            minInterval: 1,
            min: 0
        }
    ],
    series : [
        {
            name:'直接访问',
            type:'bar',
            barWidth: '60%',
            data:[null,undefined,0,1,2,3]
        }
    ]
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants