饼图label超出边界,label被遮挡,但是labelLine还在
One-line summary [问题简述]
当数据比较多的时候,图形显示区域比较小的时候,一些label会越界,只能显示labelline. 可以加校验吗,如果label 越界,labelline也不显示。
Version & Environment [版本及环境]
- ECharts version [ECharts 版本]: 3.1.6
- Browser version [浏览器类型和版本]: chrome 59
- OS Version [操作系统类型和版本]: win 10
Expected behaviour [期望结果]
label越界不显示labelline和label
ECharts option [ECharts配置项]
option = {
}
Other comments [其他信息]
你外面包一个div,然后设置一个 overflow:hidden 试试
不行,labellines是在canvas区域内显示的
请问楼主最后是如何解决的呢?我也遇到了同样问题
如果饼图扇区非常多导致 label 非常多,那么往往每个扇区都比较小,导致并不易于看清楚。 如果对比较小的扇区进行合并,统一显示一个 label,会不会效果好些?
楼主最后是怎么解决的,遇到了同样的问题
遇到同样的问题,还会出现label上面被切掉一半的情况。

推荐修改 startAngle 的起始角度值,让图表重新摆放 label 的位置 。
Hi there,
Problem I run into similar issue with label overflowing the donut-chart.
Problem JsFiddle: http://jsfiddle.net/coolbean/cj31rtpf/418/ In the jsFiddle, you can see one long name in the data "aaaaaaaaaaaaaaaaaa", which will be used as "label" for the chart. Since the name is really long, its length will exceeds the donut (overflowing).
What I expect if the label is too big for the wrapping circle, its label text should :
- be displayed as "aaa..." where "..." implies overflowing. When user hover over the label, the full text will be displayed.
- be broken into multiple lines based on user specified width and height fields on the label option. When a line exceeds the specified width, the text will start on the new line.
Possible solution My current workaround are:
- Limit the size/content of the label via label.formatter. FontSize need to be dynamic based on current Chart size.
Question I am wondering if there is an Echart option to handle this case.
try #8513
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
最后解决了么 ? 我遇到了相同的问题
推荐修改 startAngle 的起始角度值,让图表重新摆放 label 的位置 。
正解!👍
startAngle 这样数据一旦变化又会有问题
startAngle 这样数据一旦变化又会有问题
是这样,希望能有个更完善的解决办法