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 Charts if all the data are 0, should show blank, not evenly divided the pie.

See original GitHub issue

问题简述 (One-line summary)

If there are for example 4 data elements and the values are all 0, it should show a blank pie, not a pie evenly divided by 4.

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version): v3.1.10
  • 浏览器类型和版本 (Browser version): any browser
  • 操作系统类型和版本 (OS Version): windows7

current pie chart: Uploading piecurrent.p piecurrent ng…

重现步骤 (Steps to reproduce)

1.use the option provided to draw the piechart

期望结果 (Expected behaviour)

expected

可能哪里有问题 (What went wrong)

When sum is 0, assume all the parts are 2pi/N. In fact, 0 means occupy nothing no matter sum is 0 or not. The user should see nothing except the circle boundary to show no data at all.

ECharts配置项 (ECharts option)

option = {
                series: [
                  {
                      type: "pie",
                      radius: "65%",
                      itemStyle: {
                          normal: {
                              borderColor: '#fff',
                              borderWidth: '0'
                          },
                          emphasis: {
                              borderColor: '#fff',
                              borderWidth: '0'
                          }
                      },
                      label: {
                          normal: {
                              show: false
                          }
                      },
                      center: ["50%", "43%"],
                      data: [
                        {
                            "name": "21-40%",
                            "value": "0"
                        },
                        {
                            "name": "41-60%",
                            "value": "0"
                        },
                        {
                            "name": "61-80%",
                            "value": "0"
                        },
                        {
                            "name": "81-100%",
                            "value": "0"
                        }
                      ]
                  }
                ],
                color: [
                  "#FF8C00",
                  "#FFD700",
                  "#6B8E23",
                  "#3D3D3D"
                ],
                title: {
                    show: true,
                    text: "Sample",
                    left: "center",
                    top: "top"
                },
                legend: {
                    data: [
                      "21-40%",
                      "41-60%",
                      "61-80%",
                      "81-100%"
                    ],
                    left: 'center',
                    bottom: '10',
                    borderWidth: 1,
                    borderColor: '#FAAC58',
                },
                tooltip: {
                    show: true,
                    showContent: true,
                    trigger: 'item',
                    formatter: '{b}:<br />{c}',
                }

}

其他信息 (Other comments)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:9

github_iconTop GitHub Comments

1reaction
jakkireddycommented, Jun 16, 2016

I am also facing the same issue. please fix it in the next release

0reactions
stephen-bricommented, May 17, 2022

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pie Charts if all the data are 0, should show blank, not evenly ...
If there are for example 4 data elements and the values are all 0, it should show a blank pie, not a pie...
Read more >
Is it possible to show pie chart if all data are 0 - Stack Overflow
You cannot, and this because of the very nature of the pie chart. A pie chart angle is calculated (in degrees) by the...
Read more >
How-to Easily Hide Zero and Blank Values from an Excel Pie ...
Checkout the Step-by-Step Tutorial and Download the Free Sample File here: http://www.exceldashboardtemplates.co... … Show more. Show more ...
Read more >
A Complete Guide to Pie Charts | Tutorial by Chartio
Pie charts are a common but often misused visualization to show division of a whole into parts. Learn how to get the most...
Read more >
pie chart extracted values - Microsoft Power BI Community
Pie chart will always aggregate the data on category level. So when you put Answer into Pie chart, it will count the number...
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