Pie chart: chart and legends disappear if all the values are 0
See original GitHub issueWhen I pass an object with all the value equal to zero to Pie chart, as expected the chart disappear, but the legend is also missing. My chart tool has a controller when click on legend, it sets the value to 0 to hide the data from the chart. I’m setting the value to zero, to keep the legend displayed on the chart, and it’s possible to return the old values clicking again. Here’s the example of data passed to the Pie chart.
const pieChartData = [
{name: "Bar", value: 0},
{name: "Foo", value: 0}
]
The bar charts on the other hand if I pass values equal to zero, the legend and the Cartesian grid is still there. There’s mine expected behavior for the PieChart. Keep the legend to control the values.
const barChartData = [
{timestamp: 1483315200000, foo: 0, bar: 0},
{timestamp: 1483401600000, foo: 0, bar: 0}
]
Someone had this problem? There’s a workaround? Is it a bug??
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Pie Chart - legend missing one category (edited to include ...
I have set of pie charts and when I add data to some of them, there is one category name that is missing...
Read more >How to suppress 0 values in an Excel chart - TechRepublic
The pie chart doesn't chart the missing 0s, but the legend still displays the category label. Neither line chart handles the missing 0s...
Read more >How-to Easily Hide Zero and Blank Values from an Excel Pie ...
The need to hide Pie Chart Legend entries that are blank or have a value of zero (0). From this: Excel Pie Chart...
Read more >Can legends in PowerBI Pie Chart be hidden if value is zero?
First create a measure using the following dax function: Cross Filter = INT( NOT( ISEMPTY( FAC_TABLE ) ) ).
Read more >Zero Values in a Pie Chart - Excel Help Forum
From now on, that will be done by forum Moderators only. We continue to encourage the reporting of posts/threads where cross-posting has not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@xile611 Is it fixed?
Steps to reproduce open https://jsfiddle.net/L3qcx9ys/1/
Any solution or hack to overcome this?