Legend box position

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
CLON
Posts: 5
Joined: Wed Nov 15, 2017 12:34 pm

Legend box position

Post by CLON » Wed Nov 15, 2017 12:54 pm

Hi,

I'm using lightning chart for a wpf application with a very simple use case where i want to display a single bar serie.
The displaying of the data is fine but i'm concerned about the position of the legend box. I want it to be displayed outside the chart area, at the right of the chart.

I've tried several options of the LegendBoxXY position object (RightCenter, for example) but it displays the legend inside the chart area... Is there a way to display the legend near the chart ?

Regards,

Clément

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

Re: Legend box position

Post by ArctionKestutis » Wed Nov 15, 2017 1:43 pm

Hi Clément,

Yes, there is the way to get LegendBox on margins. Please enable AutoSpaceLegendBoxes and set desired position

Code: Select all

            _chart.ViewXY.AutoSpaceLegendBoxes = true;
            _chart.ViewXY.LegendBoxes[0].Position = LegendBoxPositionXY.RightCenter;
and Bar's example may look like this
BarsAutoSpaceLegendBoxes.jpg
BarsAutoSpaceLegendBoxes.jpg (229.29 KiB) Viewed 5883 times
All the best.

CLON
Posts: 5
Joined: Wed Nov 15, 2017 12:34 pm

Re: Legend box position

Post by CLON » Wed Nov 15, 2017 1:58 pm

Works perfectly, thanks for the quick answer.

Clément

Post Reply