Order of Series in Legend Box

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Martin Schmidt
Posts: 6
Joined: Thu Aug 31, 2017 8:59 am

Order of Series in Legend Box

Post by Martin Schmidt » Fri May 04, 2018 7:25 am

Hello,

I have a question regarding the order of series in a legend box.

In our case we have multiple series in one chart, one can be a SampleDataSeries, the next can be a PointLineSeries. For our users it's of no interest. They are all named CH1 to CH64.
I want to see the series sorted by their names and numbers (what is generally done fine) and not by series type. But even if I set the property Categorization to None, they are sorted by series type. The only difference is the missing series type name as category headline.

Is there a way to achieve this? Maybe I'm missing something.

Thank you in advance
Martin

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

Re: Order of Series in Legend Box

Post by ArctionKestutis » Fri May 04, 2018 2:52 pm

Hello Martin,

The LegendBox 'sorting' comes from the reading/rendering order. Original list is created by adding all FreeformPointLineSeries, then PointLineSeries, SampleDataSeries, LineCollections etc. Besides that each series list (e.g. PointLineSeries) is taken in the same order they have been added (that is rendering order as well).
If none of categories suitable for you, probably easiest solution is to create dummy/empty series in order you like with corresponding Title and Line style, while original series set

Code: Select all

Series.ShowInLegendBox = false
Hope this helps.
All the best.

sri
Posts: 3
Joined: Wed Jul 31, 2019 6:44 pm

Re: Order of Series in Legend Box

Post by sri » Wed Jul 31, 2019 7:53 pm

hi, is there any way to sort series itself before rendering. In my case i want to display stock series first and bar series second. but i am unable to find and work around. And is there any select all checkbox functionality in legend?

Arction_LasseP
Posts: 141
Joined: Wed Mar 27, 2019 1:05 pm

Re: Order of Series in Legend Box

Post by Arction_LasseP » Thu Aug 01, 2019 7:51 am

Hello,

Unfortunately there currently isn't a way to change the order of the series in a LegendBox. The order is determined by the rendering order of the various series types in our source code, meaning that for instance BarSeries is always shown before StockSeries. So unless you have bought access to the source code, this cannot be changed.

A workaround could be to use several LegendBoxes and modify their position (via Offset -property) and visual style so that they seem to appear as one box. Alternatively, an empty dummy series can be created. Disable ShowInLegendBox for the main series and enable it for the dummy series. Use another series type for the dummy to change its position in the LegendBox.

As for the question of selecting all functionality, check the other thread where it is explained how this can be implemented.
https://forum.arction.com/viewtopic.php?f=16&t=2253

Best regards,
Lasse

Post Reply