Pre loader

RenderableSeries Z-Order

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

This is probably simple but I searched the forums and documentation and couldn’t find anything. Am I able to determine the Z-Order of my series? For example if I have a series that I always want to appear on top. It seems like this is determined by the order that I add a series to the RenderableSeries collection. My issue is that I would like a specific series to show up first in the legend, but also on top of each other series on my chart. If I add it to RenderableSeries last, it will be at the bottom of the legend. In the LegendModifier.LegendData series info objects I do not see a value I could easily set to define the order in the legend. That would really be find for the time being.
So I either need a way to define the order of the objects in the legend or their render order, and need to be able to handle multiple series (for example order by series 1-2-3, 3-2-1, 2-1-3, etc.)

I apologize if this is somewhere obvious and I missed it.

Thank you

  • You must to post comments
0
0

Hi there,

Thanks for the inquiry!

Concerning the request, please, take a look at this thread on this topic, also at these articles: Changing ZOrder of RenderableSeries, Selection and SelectedSeries Styling, Selected Series API. I would suggest you to play around with order of series in RenderableSeries collection..

And regarding order of series in the legend, it gets the data from LegendModifier.LegendData property. It is of type ChartDataObject and contains collection of SeriesInfo objects inside. So you could change order of its items inside binding’s value converter, based on SeriesInfo.RenderableSeries.IsSelected property.

Alternatively, you could create a custom modifier which will provide property of ChartDataObject which will be used as source for LegendControl. To do this, you need to gather info from RenderableSeries inside loop using hit-test API:

        // inside custom modifier class
        var seriesInfo = new ObservableCollection<SeriesInfo>();

            foreach (var renderableSeries in ParentSurface.RenderableSeries)
            {
                // Hit test each series
                var hitResult = renderableSeries.DataSeries.HasValues
                                    ? renderableSeries.HitTest(new Point(ModifierSurface.ActualWidth, 0))
                                    : default(HitTestInfo);

                 // Get series info
                var s = renderableSeries.GetSeriesInfo(hitResult);

                seriesInfo.Add(s);
            }

           LegendData = new ChartDataObject { SeriesInfo = new ObservableCollection<SeriesInfo>() }

Hope this helps! Please, feel free to ask if you need more assistance with this.

Best regards,
Yuriy

  • Matt Machalinski
    Yuriy, This helps a bit, but doesn't really answer my question. What if I want to order multiple series in some dynamic fashion, how would I order with two marked as IsSelected? Also, in the LegendModifier.LegendData series info objects I do not see a value I could easily set to define the order in the legend. That would really be find for the time being. So I either need a way to define the order of the objects in the legend or their render order, and need to be able to handle multiple series (for example order by series 1-2-3, 3-2-1, 2-1-3, etc.) Thank you, Matt
  • Matt Machalinski
    I'm sorry, I don't believe this was answered or I missed it. Is there a way to dictate the order of series either in the legend or in the rendering outside of IsSelected? Can I specify a specific order somehow, and potentially change that order dynamically?
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies