echarts icon indicating copy to clipboard operation
echarts copied to clipboard

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

Open chenmqiang opened this issue 9 years ago • 14 comments

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

chenmqiang avatar Jul 20 '17 07:07 chenmqiang

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

CWSchen avatar Jul 20 '17 07:07 CWSchen

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

chenmqiang avatar Jul 21 '17 02:07 chenmqiang

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

Shawnhoo666 avatar Nov 05 '17 04:11 Shawnhoo666

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

100pah avatar Nov 05 '17 15:11 100pah

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

mlf75 avatar Nov 28 '17 01:11 mlf75

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

zhangya5847 avatar Nov 30 '17 03:11 zhangya5847

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

davinma avatar Mar 09 '18 03:03 davinma

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.

Paul-Kijtapart avatar Apr 02 '18 18:04 Paul-Kijtapart

try #8513

airwin avatar Jun 13 '18 10:06 airwin

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.

stale[bot] avatar Jun 12 '20 11:06 stale[bot]

最后解决了么 ? 我遇到了相同的问题

zhoufanglu avatar Apr 27 '21 05:04 zhoufanglu

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

正解!👍

lifedever avatar May 07 '21 07:05 lifedever

startAngle 这样数据一旦变化又会有问题

JSjump avatar Jan 14 '23 07:01 JSjump

startAngle 这样数据一旦变化又会有问题

是这样,希望能有个更完善的解决办法

CoolWind0719 avatar Mar 03 '23 03:03 CoolWind0719