microcharts-dotnet / Microcharts

Create cross-platform (Xamarin, Windows, ...) simple charts.
MIT License
2.02k stars 361 forks source link

Label placement do not take into the consideration the length of the Label Value #261

Closed dev8546 closed 3 years ago

dev8546 commented 3 years ago

What we have found that when we send the Label name and value both. Maximum label length calculation does not take the length of the Label VALUE into the consideration. To explain better i am attaching the screenshots

as it can be seen amount below the Swiggy label is cutting the currency symbol. (Revenue by Source) Issue

After i have applied the fix now you can see the same chart is also taking into account the Value content length Fixed

FIX In the file CanvasExtensions.cs in DrawCaptionLabels method

We missed to to get valueBounds.Standardized Fixed code will be if (totalBounds.IsEmpty){ totalBounds = valueBounds.Standardized; } else { totalBounds.Union(valueBounds.Standardized); }

eman1986 commented 3 years ago

Thanks for fixing this, it's merged in.

Nymu5 commented 2 years ago

Still experiencing the same issue though, with the newest NuGet version on iOS (Xamarin.Forms). The labels and values on the right and left are clipping of the canvas. Any way to fix this?

Bildschirmfoto 2022-07-26 um 16 43 19