Legend box content truncated when resize

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Posts: 8
Joined: Mon Jun 20, 2022 3:23 pm

Legend box content truncated when resize

Post by tingyunwang120 » Mon Jun 20, 2022 3:57 pm

When resizing the legend box smaller, it cut off the content as shown in the picture, I know there is a way of showing the vertical and horizontal bar, but it is still not ideal. Is there any way to make the content auto-fit in the new size of the legend box?
Capture.PNG (28.72 KiB) Viewed 29 times
Last edited by tingyunwang120 on Tue Jun 21, 2022 11:02 am, edited 1 time in total.

Posts: 139
Joined: Wed Mar 27, 2019 1:05 pm

Re: Legend box content truncated when resize

Post by Arction_LasseP » Tue Jun 21, 2022 7:07 am


Currently there isn't such option to make the contents of the Legend Box to fit to certain size. There is AutoSize property which when enabled, automatically resizes the Legend so that all of its contents fit into it, but this is pretty much the opposite of what you are looking for.

Currently the only way to do this is to manually change the Legend Box contents. For example:

Code: Select all

_chart.ViewXY.LegendBoxes[0].IntensityScales.ScaleSizeDim1 = 50; // These change the color bar size.
_chart.ViewXY.LegendBoxes[0].IntensityScales.ScaleSizeDim1 = 100;
_chart.ViewXY.LegendBoxes[0].SeriesTitleFont.Size = 12;
_chart.ViewXY.LegendBoxes[0].ValueLabelFont.Size = 10;
_chart.ViewXY.LegendBoxes[0].CheckBoxSize = 8;
If you want to modify those when resizing the Legend Box, you would need to call then inside some mouse event, for instance MouseMove (check if Legend Box size has changed and modify them accordingly).

Kind regards,