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

双轴,y轴设置了min之后,柱形图如果有负数,显示有问题 #5069

Closed
fsx379 opened this issue Feb 14, 2017 · 6 comments
Closed
Labels

Comments

@fsx379
Copy link

fsx379 commented Feb 14, 2017

One-line summary [问题简述]

双轴,
左边轴,用于显示柱状图,其中数据有负数;
右边轴显示其他数据。由于右边轴显示数据波动范围小,故需要设置min、max。

如果min设置为 0或负数,左轴的柱状图显示没问题;
如果min设置为正数,左轴的柱状图显示有问题,不是从0开始的,而是从最下方开始。详细见代码;

Version & Environment [版本及环境]

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

Expected behaviour [期望结果]

即使设置了min,柱状图也能正常显示(从0开始显示)

ECharts option [ECharts配置项]

option = {
color: ['#3398DB'],
    xAxis : [
        {
            type : 'category',
            data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        }
    ],
    yAxis : [
        {
            type : 'value'
        },
        {
            type: 'value',
            axisLabel: {
                formatter: '{value} %'
            },
            min: 0, max: 80
        }
    ],
    series : [
        {
            name:'直接访问',
            type:'bar',
            // barWidth: '60%',
            data:[1000, -520, -2000, -3340, 3900, -330, -5220]
        }
    ]
}

Other comments [其他信息]

正确的:
image

有问题的:
image

@pissang pissang added the bug label Feb 14, 2017
@johnhuang669
Copy link

請問這個bug甚麼時候可以修正??已經過很久了 而且是很常發生的bug

@johnhuang669
Copy link

請問有看到嗎???

@chisuru
Copy link

chisuru commented Jul 6, 2017

这个问题我也碰到了, 3.5.4版还有这个问题
看起来像是设定双轴的时候, 0以下的柱状图没有弄成相反顯示.
例如第1, 第5根0以下是全满的柱状图, 把它消掉 就正常了
其它根柱状图 把0以下 没图的部份画上正常的柱状图, 有图的部份 消掉 也正常了

@jsiwa
Copy link

jsiwa commented Jul 14, 2017

我暂时用这个自定义方法实现效果
http://echarts.baidu.com/tutorial.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B3%BB%E5%88%97

@100pah
Copy link
Member

100pah commented Jul 15, 2017

在当前版本 3.6.x 看起来已经没有这个问题了。

@100pah 100pah closed this as completed Jul 15, 2017
@chisuru
Copy link

chisuru commented Jul 17, 2017 via email

@100pah 100pah reopened this Jul 17, 2017
@100pah 100pah closed this as completed in 1064b3f Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants