ThinkGeo.com    |     Documentation    |     Premium Support

Resize legend to fit the longest legend item in v12

Is there any way to resize the legend fit to the longest legend item in v12?
As there is a topic for v10: Resize legend to fit the longest legend item

I also use this code which didn’t work:

var textGeoCanvas = new SkiaGeoCanvas();
var legendWidth = textGeoCanvas.MeasureText(legendItem.TextStyle.TextColumnName, legendItem.TextStyle.Font).Width;

Thanks Mahdi,
There is an issue in V12 to measure text. We have fixed it. The daily build process will update the package in the NuGet. I will let you know and provide you the updated sample in Resize legend to fit the longest legend item tomorrow.

Thanks

Frank

1 Like

Thanks Mahdi,
We have fixed the issue. You can try with latest nugget V12 beta version. I also attached the full sample here.

LegendTest - Nuget.zip (11.8 KB)

Thanks

Frank

1 Like

Thanks Franks,

It’s work fine.

No problem, Go ahead let us know if you have any more questions.

Thanks

Frank