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 - setting "minShowLabelAngle" in "media" cause label line artifacts #16436

Closed
j-zielinski opened this issue Jan 26, 2022 · 8 comments

Comments

@j-zielinski
Copy link

j-zielinski commented Jan 26, 2022

Version

5.2.2, 5.3.0-rc.1

Link to Minimal Reproduction

https://codesandbox.io/s/recursing-torvalds-tjuxw?file=/src/index.js

Steps to Reproduce

  1. Open Codesandbox
  2. Resize window below and over 500px width
  3. You will notice some label lines are still rendered when they should not

Current Behavior

pie-chart-label

Expected Behavior

If label is not visible anymore, corresponding line should also disappear.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

Code:

export const options = {
  dataset: {
    dimensions: [
      {
        name: 'Job',
        id: 'job',
      },
      {
        name: 'Candidates',
        id: 'count',
      },
    ],
    source: [
      ['231030', 63],
      ['288230', 41],
      ['424080', 8],
      ['387581', 7],
      ['293479', 6],
      ['__empty__', 6],
      ['244185', 4],
      ['262793', 4],
      ['262635', 3],
      ['297479', 3],
      ['187996', 2],
      ['276594', 2],
      ['355507', 2],
      ['495143', 2],
      ['55342', 1],
      ['59508', 1],
      ['263196', 1],
      ['266390', 1],
      ['266392', 1],
      ['280606', 1],
      ['293256', 1],
      ['324698', 1],
      ['355509', 1],
      ['384268', 1],
      ['424166', 1],
      ['430854', 1],
      ['473469', 1],
      ['490810', 1],
    ],
  },
  series: [
    {
      type: 'pie',
    },
  ],
  media: [
    {
      query: {
        maxWidth: 500,
      },
      option: {
        series: [
          {
            minShowLabelAngle: 8,
          },
        ],
      },
    },
    {
      query: {
        minWidth: 500,
      },
      option: {
        series: [
          {
            minShowLabelAngle: 4,
          },
        ],
      },
    },
  ],
};
@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. waiting-for: community labels Jan 26, 2022
@Ovilia Ovilia added the missing-demo The author should provide a demo. label Jan 27, 2022
@echarts-bot
Copy link

echarts-bot bot commented Jan 27, 2022

@j-zielinski Please provide a demo for the issue either with https://codepen.io/Ovilia/pen/dyYWXWM , or https://codesandbox.io/s/mystifying-bash-2uthz.

@Ovilia
Copy link
Contributor

Ovilia commented Jan 27, 2022

Sorry I can't open the link you provided. Please save it at the above links mentioned by the bot.
This problem should have been fixed in 5.3.0.

@j-zielinski
Copy link
Author

@j-zielinski
Copy link
Author

@Ovilia I just wanted to let you know that this bug still occurs in 5.3.0.

@yangfei4913438
Copy link

我也遇到了同样的问题。label消失了,labelLine依然显示在图表上。一开始我以为是设置了show为true的原因,后来取消了show的配置,使用空对象,依然是label消失的时候labelLine不消失。
image

@yangfei4913438
Copy link

yangfei4913438 commented Mar 1, 2022

抱歉,我无法打开您提供的链接。请将其保存在机器人提到的上述链接中。 这个问题应该已经在 5.3.0 中修复了。

在官网的demo中就可以复现这个问题。

链接: https://echarts.apache.org/examples/zh/editor.html?c=pie-simple

请使用下面的JS代码来复现:

option = {
  title: {
    text: 'Referer of a Website',
    subtext: 'Fake Data',
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      // 修改这个值的大小来复现问题
      minShowLabelAngle: 30,
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
};

@Ovilia

@j-zielinski
Copy link
Author

@Ovilia any update on this ?

@j-zielinski
Copy link
Author

@Ovilia This problem seems to have been solved here: #17412. So in 5.4.0 it can be considered as fixed. Thanks! :)

@plainheart plainheart added resolved topic: pie topic: label and removed pending We are not sure about whether this is a bug/new feature. missing-demo The author should provide a demo. labels Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants