question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pie chart: chart and legends disappear if all the values are 0

See original GitHub issue

When 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
vikramkhot111commented, Jan 2, 2020

@xile611 Is it fixed?

Steps to reproduce open https://jsfiddle.net/L3qcx9ys/1/

0reactions
clluizcommented, Aug 25, 2021

Any solution or hack to overcome this?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found