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 (and other) charts with label going outside of canvas

See original GitHub issue

问题简述 (One-line summary)

Pie charts with sections with long name have the labels that overlap / go out of the canvas (so no more visible)

版本及环境 (Version & Environment)

  • ECharts 版本 3.2.3:
  • Chrome 52.0.2743.116 (64-bit):
  • MAC OS-X El Capitan 10.11.6 (OS Version):

重现步骤 (Steps to reproduce)

  1. Create a pie chart with several sections with long labels (PROBLEM)
  2. Reduce the page size and reload (Same Problem and often overlap)

期望结果 (Expected behaviour)

The labels should stay visible even when they are too long.

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

The labels are not visible and often overlap

ECharts配置项 (ECharts option)

            scope.distributionEvent = {
                identity: $echarts.generateInstanceIdentity(),
                dimension: '10:4',
                config: {
                    tooltip: {
                        trigger: 'item',
                        formatter: "{b} : {c} ({d}%)",
                        zlevel: 2,
                        z: 100
                    },
                    series: [
                        {
                            name: "Event distribution",
                            type: 'pie',
                            radius: ['60%', '70%'],
                            center: ['50%', '55%'],
                            itemStyle : {
                                normal : {
                                    label : {
                                        show : true
                                    },
                                    labelLine : {
                                        show : true,
                                        length: 5
                                    }
                                }
                            },
                            data: [{"name":"New investment","value":6},{"name":"Merger and Acquisition","value":9},{"name":"Bankruptcy","value":3},{"name":"New business relation","value":8},{"name":"Official resignations and appointments","value":1},{"name":"End of activity","value":1},{"name":"New market","value":2},{"name":"New product","value":3},{"name":"New unit","value":1}]
                        }
                    ]
                }
            };

其他信息 (Other comments)

capture d ecran 2016-09-13 a 17 49 07

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:13
  • Comments:34 (5 by maintainers)

github_iconTop GitHub Comments

13reactions
Oviliacommented, Aug 21, 2018

Hi, since this feature is required frequently, we put it in our priority list and will dive into it.

6reactions
haoye999commented, Sep 7, 2020

This has been fixed. Labels will have “…” when too long. See https://echarts.apache.org/examples/zh/editor.html?c=pie-alignTo .

It will be invalid when i set formatter

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pie (and other) charts with label going outside of canvas #4082
问题简述 (One-line summary) Pie charts with sections with long name have the labels that overlap / go out of the canvas (so no...
Read more >
chart.js: Show labels outside pie chart - Stack Overflow
There is a new plugin (since a year), called chartjs-plugin-piechart-outlabels. Just import the source
Read more >
How to Show Data Labels Inside and Outside the Pie Chart in ...
It requires a lot of different moving parts to work along. The canvas tag, javascript, arrays and Chart JS all need to be...
Read more >
How to make a pie chart with HTML5's canvas
The function drawSegmentLabel adds the labels to the pie chart. You might wonder: how are we going to get the text rotated to...
Read more >
HTML5 & JS Pie Charts - CanvasJS.com
If labels are not provided, y value is used as index label. Cannot be combined with: Any other Chart type. Pie Chart Specific...
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