Skip to content

[Bug] Pie chart: minShowLabelAngle and label.position break down together #17712

@sirAbramstone

Description

@sirAbramstone

Version

5.4.0

Link to Minimal Reproduction

https://codepen.io/Pikcher/pen/xxjYqMQ

Steps to Reproduce

  1. Chart creates as usual: echarts.init(container); instance.setOption(options);.
  2. Options:
options = {
  series: [{
      type: 'pie',
      radius: ['40%', '70%'],
      minShowLabelAngle: 100,
      label: {
        show: true,
        position: 'inside',
      },
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ]
    }]
}
  1. Problem become visible immediately after widget's initialisation

Current Behavior

Function "pieLabelLayout" that's placed in lib/chart/pie/labelLayout.js bring about code execution failure with error: TypeError: Cannot read properties of undefined (reading 'states'). It happens when chart has options pie-series.minShowLabelAngle and pie-series.label.position === 'inside' or pie-series.label.position === 'inner' together. You can see labels that should be hidden are displayed in top left corner of the chart.

image

Expected Behavior

Labels should not be displayed according to the minShowLabelAngle setting.

Environment

- OS: macOS Monterey
- Browser: Chrome 105.0.5195.125
- Framework: Vue@2

Any additional comments?

It seems like bug appears in version 5.4.0., I did't watch that behavior in previous minor version.

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