apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.63k stars 19.61k forks source link

堆叠柱状图在dataset数据源下值为0时label出现重叠,如何不显示其中某些数据的label #9438

Closed charon316 closed 3 years ago

charon316 commented 5 years ago

General Questions

PLEASE MAKE SURE OF ALL THE FOLLOWING OPTIONS IN REQUIRED FIELDS ARE TICKED (with x)! Otherwise, the issue will not be answered. And think before you tick. :) 请确保以下每项都打上勾了!并且确保都做了这些事哦~ 这将大量简化我们的工作流程,使你的问题更快速得到解答。

In this issue, I have provided information with: 在这个 issue 中我提供了以下信息:

Issue Type

Issue Details

堆叠柱状图在使用dataset作为数据源时,当某一项的值为0时,该项的label与前一数据的label重叠的情况。能否在页面上不显示为0的label?

Expected Behavior

数据为0时,label不显示。(tooltip中依旧可以看到为0的项)

Current Behavior

堆叠柱状图在使用dataset作为数据源时,当某一项的值为0时,该项的label与前一数据的label重叠。

Online Example

THIS IS REQUIRED FOR ALL BUG REPORTS AND QUESTIONS!!! 如果是提问或报 bug 一定要提供这一项!

demo链接

有尝试在label的formmater中进行手动控制返回,但是没有生效。 formatter: function(data) { for(let i in data.data) { if (typeof i==='number') { if (i>0) { return i; } return ''; } return i; } }

Topics

Anything Else We Need to Know

issue #5657 提到了类似的问题,但是没有提供解法就关闭掉了。

Environment

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!