Skip to content

正负条形图 label 展示问题 #17801

@chengazhen

Description

@chengazhen

Version

5.3.3

Link to Minimal Reproduction

No response

Steps to Reproduce

option = {
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  },
  legend: {
    data: ['Profit', 'Expenses', 'Income']
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: [
    {
      type: 'value'
    }
  ],
  yAxis: [
    {
      type: 'category',
      axisTick: {
        show: false
      },
      data: ['Mon', 'Tue', 'Wed', 'Thu']
    }
  ],
  series: [
  
    {
      name: 'Income',
      type: 'bar',
      stack: 'Total',
      label: {
        show: true
      },
      emphasis: {
        focus: 'series'
      },
      data: [1, 1, 35, 1]
    },
    {
      name: 'Expenses',
      type: 'bar',
      stack: 'Total',
      label: {
        show: true,
        position: 'left'
      },
      emphasis: {
        focus: 'series'
      },
      data: [-1, -20, 0, -1]
    }
  ]
};

Current Behavior

image
值为0 的label应该在 左边展示, 但是展示位置在 右边

Expected Behavior

值为0 的label应该在 左边展示, 但是展示位置在 右边

Environment

- OS:
- Browser:Chrome  106.0.5249.119
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    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