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.

Zero sum pie chart

See original GitHub issue

What problem does this feature solve?

I want to show the color legends for zero sum pie chart however it plots colors equally

image

What does the proposed API look like?

In the new feature the chart should not show the series if the sum is zero. Instead it should continue to show the legend however for chart it should only show 1 circle.

I am looking something like this. Check the legend has color and chart is disabled circle

image

I tried this workaround but legend has no color.

option = {
  tooltip: {
    trigger: 'item'
  },
  legend: {
    top: '5%',
    left: 'center',
    selected : {'Search Engine (0)':false,'Direct (0)' :false}
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: ['40%', '70%'],
      avoidLabelOverlap: false,
      label: {
        show: false,
        position: 'center'
      },
      emphasis: {
        label: {
          show: true,
          fontSize: '40',
          fontWeight: 'bold'
        }
      },
      labelLine: {
        show: false
      },
      data: [
        { value: 0, name: 'Search Engine (0)' },
        { value: 0, name: 'Direct (0)' }
      ]
    }
  ]
};

image

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pissangcommented, Nov 27, 2021

@plainheart Yeah that’s not supposed to happen. Set the value to '-' can solve this issue.

0reactions
plainheartcommented, Nov 26, 2021

This looks like a bug. When the sum is zero, the pie is invisible and the border shouldn’t be drawn. @pissang WDYT?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pie chart - MATLAB pie - MathWorks
This MATLAB function draws a pie chart using the data in X. ... If sum(X) ≤ 1 , then the values in X...
Read more >
Solved: Pie Chart to display also zero values
Solved: Hello I have a table where I show for each segment a value (calculated with a measure). The table shows me correctly...
Read more >
How-to Easily Hide Zero and Blank Values from an Excel Pie ...
Pie Charts In Excel. How-to Easily Hide Zero and Blank Values from an Excel Pie Chart Legend. 21K views 7 years ago.
Read more >
Hide Category & Value in Pie Chart if value is zero
I'm plotting a pie chart in my excel file, with the use of above table and using only ColumnA & ColumnD data. ColumnD...
Read more >
Excel: How to not display labels in pie chart that are 0%
See the article How to suppress 0 values in an Excel chart for various solutions that depend on your context. The easiest is...
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