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

折线图的markLine,当只有一条数据时,会出现markLine不能从最左端绘制到最右端的问题 #2762

Closed
EyrebaLeo opened this Issue Mar 9, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@EyrebaLeo

EyrebaLeo commented Mar 9, 2016

问题简述 (One-line summary)

折线图的markLine,当只有一条数据(不管是坐标轴类型时类目轴还是time轴)时,会出现markLine不能从最左端绘制到最右端的问题

版本及环境 (Version & Environment)

  • ECharts 版本 (3.1.2):
  • 浏览器类型和版本 (Chrome,版本 48.0.2564.116 m):
  • 操作系统类型和版本 (windows7 专业版):

重现步骤 (Steps to reproduce)

1.设置只有一条数据的series,并且type设置成'line'或者‘bar'
2.设置markLine,设为平均数,或者手动设置某一数值的markLine,从0开始到x坐标的最大值结束;
3.setOption能看到绘制效果

期望结果 (Expected behaviour)

虽然数据只有一条,但是markLine仍然能够从最左端绘制到最右端

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

可能绘制的起点和终点有问题

ECharts配置项 (ECharts option)

option = {
  xAxis : [
        {
            type : 'category',
            boundaryGap : false,
            data : ['周一','周二','周三','周四','周五','周六','周日']
        }
    ],
    yAxis : [
        {
            type : 'value',
            axisLabel : {
                formatter: '{value} °C'
            }
        }
    ],
    series : [
        {
            name:'最高气温',
            type:'line',
            data:[11],

            markLine : {
                data : [
                    {type : 'average', name: '平均值'}
                ]
            }
        }
    ]
}

其他信息 (Other comments)

image

@pissang

This comment has been minimized.

Show comment
Hide comment
@pissang

pissang Mar 9, 2016

Contributor

3b9497f 中已经修复这个问题

Contributor

pissang commented Mar 9, 2016

3b9497f 中已经修复这个问题

@pissang pissang closed this Mar 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment