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] pictorialBar data为0的项显示错误 #16423

Closed
Colin3191 opened this issue Jan 25, 2022 · 3 comments · Fixed by #16469
Closed

[Bug] pictorialBar data为0的项显示错误 #16423

Colin3191 opened this issue Jan 25, 2022 · 3 comments · Fixed by #16469
Labels
bug difficulty: easy Issues that can be fixed more easily than the average. topic: custom

Comments

@Colin3191
Copy link

Colin3191 commented Jan 25, 2022

Version

5.2.2

Link to Minimal Reproduction

https://codesandbox.io/s/y8te0

Steps to Reproduce

option = {
  color: ["#47D3FF"],
  series: [
    {
      type: "pictorialBar",
      itemStyle: {
        show: true,
        color: "#47D3FF",
        borderWidth: 2
      },
      symbol: "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",
      data: [
        {
          value: 3097
        },
        {
          value: 0
        }
      ],
      yAxisIndex: 0,
      stack: false
    }
  ],
  tooltip: {
    show: true
  },
  xAxis: [
    {
      axisPointer: {
        show: true
      },
      data: ["公司", "消费者"]
    }
  ],
  yAxis: [
    {
      type: "value"
    }
  ]
}

Current Behavior

鼠标悬浮到任意一个柱子上,其他地方都会出现奇怪的图形。

Expected Behavior

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

满足以下条件时,貌似就会出现这样的情况
1.类型为pictorialBar,symbol为”path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z“
2.data设置成0
3.series设置了itemStyle,且itemStyle里设置了borderWidth
4.xAxis设置了axisPointer

@Colin3191 Colin3191 added the bug label Jan 25, 2022
@echarts-bot echarts-bot bot added pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jan 25, 2022
@echarts-bot
Copy link

echarts-bot bot commented Jan 25, 2022

@Colin3191 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] Items with pictorialBar data of 0 are displayed incorrectly

BODY

Version

5.2.2

Link to Minimal Reproduction

https://codesandbox.io/s/y8te0

Steps to Reproduce

option = {
color: ["#47D3FF"],
series: [
{
type: "pictorialBar",
itemStyle: {
show: true,
color: "#47D3FF",
borderWidth: 2
},
symbol: "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",
data: [
{
value: 3097
},
{
value: 0
}
],
yAxisIndex: 0,
stack: false
}
],
tooltip: {
show: true
},
xAxis: [
{
axisPointer: {
show: true
},
data: ["Company", "Consumer"]
}
],
yAxis: [
{
type: "value"
}
]
}

Current Behavior

Hover the mouse over any column, and strange graphics will appear elsewhere.

Expected Behavior

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

This seems to happen when the following conditions are met

  1. The type is pictorialBar, and the symbol is "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z"
    2.data is set to 0
    3.series set itemStyle
    4.xAxis sets axisPointer

@Colin3191
Copy link
Author

好像是设置了borderWidth导致的

@Ovilia Ovilia added difficulty: easy Issues that can be fixed more easily than the average. topic: custom and removed pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Jan 27, 2022
@echarts-bot
Copy link

echarts-bot bot commented Jan 27, 2022

This issue is labeled with difficulty: easy.
@Colin3191 Would you like to debug it by yourself? This is a quicker way to get your problem fixed. Or you may wait for the community to fix.

Please have a look at How to debug ECharts if you'd like to give a try. 🤓

pissang added a commit that referenced this issue Feb 11, 2022
fix(pictorialBar): set valueLineWidth NaN value to zero. close #16423
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug difficulty: easy Issues that can be fixed more easily than the average. topic: custom
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants