Incubator-echarts: 饼图label超出边界,label被遮挡,但是labelLine还在

Created on 20 Jul 2017  ·  10Comments  ·  Source: apache/incubator-echarts

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 [其他信息]


enhancement stale

Most helpful comment

推荐修改 startAngle 的起始角度值,让图表重新摆放 label 的位置 。

All 10 comments

你外面包一个div,然后设置一个 overflow:hidden 试试

不行,labellines是在canvas区域内显示的

请问楼主最后是如何解决的呢?我也遇到了同样问题

如果饼图扇区非常多导致 label 非常多,那么往往每个扇区都比较小,导致并不易于看清楚。
如果对比较小的扇区进行合并,统一显示一个 label,会不会效果好些?

楼主最后是怎么解决的,遇到了同样的问题

遇到同样的问题,还会出现label上面被切掉一半的情况。
image

推荐修改 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 :

  1. be displayed as "aaa..." where "..." implies overflowing. When user hover over the label, the full text will be displayed.
  2. 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:

  1. 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.

Was this page helpful?
0 / 5 - 0 ratings