Page 1 of 1

Legend box content truncated when resize

Posted: Mon Jun 20, 2022 3:57 pm
by tingyunwang120
Hi,
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?

Re: Legend box content truncated when resize

Posted: Tue Jun 21, 2022 7:07 am
by Arction_LasseP
Hello,

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,
Lasse