swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

Chart legends truncated #1537

Open mmonteiroc opened 3 years ago

mmonteiroc commented 3 years ago

Hello,

I'm getting an issue that's the legends texts are getting truncated with the ellipsis on mobile version. (that should be the normal behavior if they don't have enougth space).

The problem is that I'm getting this issue even when they have space (I'm only getting the issue on IOS devices [all browsers, desktop google chrome simulator of mobile --> I'm not getting this issue])

image

Thanks :)

homj commented 3 years ago

I'm seeing this issue on Safari as well. Can you confirm that?

mmonteiroc commented 3 years ago

Don't think they will fix this issue...

StefanLobbenmeier commented 1 year ago

It seems this is caused by this calculation being off by 1 between chrome and safari (maybe related to fonts or sth?): image

On Safari it works when I decrease to 19, in chrome in breaks when i increase to 21

Will see if I can do a PR for decreasing to 19 and hopefully that fixes it everywhere.

StefanLobbenmeier commented 1 year ago

The example actually works in Safari, there up to 25 is ok. In stackblitz the cutoff is at 20 again, so this is actually a good example where official charts are broken in safari: https://swimlane.gitbook.io/ngx-charts/examples/pie-charts/pie-chart

StefanLobbenmeier commented 1 year ago

The -20 was introduced in #487