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)
- Create a pie chart with several sections with long labels (PROBLEM)
- 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)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:34 (5 by maintainers)
Top 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 >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
Hi, since this feature is required frequently, we put it in our priority list and will dive into it.
It will be invalid when i set formatter