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

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

Closed
sirAbramstone opened this issue Sep 28, 2022 · 5 comments · Fixed by #17715
Closed

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

sirAbramstone opened this issue Sep 28, 2022 · 5 comments · Fixed by #17715

Comments

@sirAbramstone
Copy link

sirAbramstone commented Sep 28, 2022

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.

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Sep 28, 2022
@plainheart plainheart added topic: pie topic: label and removed pending We are not sure about whether this is a bug/new feature. labels Sep 29, 2022
@plainheart
Copy link
Member

Thanks for your feedback! This is an unexpected error brought by #17412. The labelLine may be undefined.

@echarts-bot
Copy link

echarts-bot bot commented Sep 29, 2022

This issue is labeled with priority: high, which means it's a frequently asked problem and we will fix it ASAP.

@plainheart
Copy link
Member

@sirAbramstone I'm sorry about this bug. If it's serious and is a blocker for your project, you can do a patch for current package or use today's nightly version later.

npm i echarts@npm:[email protected]

@sirAbramstone
Copy link
Author

@plainheart thank you, I'll really appreciate this.

@wilnerjs
Copy link

@sirAbramstone I'm sorry about this bug. If it's serious and is a blocker for your project, you can do a patch for current package or use today's nightly version later.

npm i echarts@npm:[email protected]

@plainheart thks!

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

Successfully merging a pull request may close this issue.

3 participants