Skip to content

堆叠柱状图,有数值为0的时候,0会覆盖前提个柱状 #5657

@wupj1993

Description

@wupj1993

One-line summary [问题简述]

image
如图label里数值模糊的数据被0覆盖

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:3.5.2包含之前的好像都有
  • Browser version [浏览器类型和版本]: 谷歌57
  • OS Version [操作系统类型和版本]:win7

Expected behaviour [期望结果]

ECharts option [ECharts配置项]

option = {
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器,坐标轴触发有效
            type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
        }
    },
    legend: {
        data: ['直接访问', '邮件营销','联盟广告','视频广告','搜索引擎']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis:  {
        type: 'value'
    },
    yAxis: {
        type: 'category',
        data: ['周一','周二','周三','周四','周五','周六','周日']
    },
    series: [
        {
            name: '直接访问',
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
            },
            data: [2, 0, 0, 0, 0, 0, 5]
        },
        {
            name: '邮件营销',
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
            },
            data: [0, 0, 4, 5, 0, 5, 0]
        },
        {
            name: '联盟广告',
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
            },
            data: [7, 0, 4, 0, 4, 1, 7]
        },
        {
            name: '视频广告',
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
            },
            data: [0, 0, 0, 1, 0, 0, 0]
        },
        {
            name: '搜索引擎',
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
            },
            data: [0, 0, 0, 1, 1, 1, 0,1]
        }
    ]
}

Other comments [其他信息]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions