Legendbox label size

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
cchrc
Posts: 8
Joined: Mon Oct 19, 2020 10:59 pm

Legendbox label size

Post by cchrc » Wed Sep 21, 2022 9:02 am

Hello,
Please consider the attached images of a horizontal-aligned legendbox.
It seems that each label gets its size from the larger label. This could be ok when label have the same size, more or less. In my case the result is not very nice.
Would it be possible to have each label allocating just the needed space for its content?
Thanks,
Attachments
legend-ko.png
legend-ko.png (3.3 KiB) Viewed 147 times
legend-ok.png
legend-ok.png (1.71 KiB) Viewed 147 times

ArctionKestutis
Posts: 469
Joined: Mon Mar 14, 2016 9:22 am

Re: Legendbox label size

Post by ArctionKestutis » Wed Sep 21, 2022 12:22 pm

Hello,
The length of text string in LegendBox is the same for all series. And it is based on longest series title. The shorter strings are padded with empty space. That was in original design, therefore, reworking Legendbox rendering will be a challenge.

There are some ways to manipulate layout, but it is not straightforward.
* You can try using legend.Layout setting ‘Vertical’.
* You can create multiple LegendBoxes and use offset property to arrange them (each Series has LegendBoxIndex, and after Chart is rendered you can read size LegendBoxes.GetRenderedRect()).

cchrc
Posts: 8
Joined: Mon Oct 19, 2020 10:59 pm

Re: Legendbox label size

Post by cchrc » Wed Sep 21, 2022 3:42 pm

Hi Kestutis,
thanks for your reply.

In this particular case I'm going to try to make the longer label smaller.
In any case, it would be nice if you would consider introducing an option to have labels with dynamic widths.

ArctionKestutis
Posts: 469
Joined: Mon Mar 14, 2016 9:22 am

Re: Legendbox label size

Post by ArctionKestutis » Thu Sep 22, 2022 7:26 am

The request for feature has been recorded.

If you have more requests and would like to influence our development roadmap, you could visit our polls for the 'hot' features: Vote for the features 1-10 or Vote for the features 11-20.

Post Reply