Pre loader

Drawing Points In A Specified Z Order Across Series

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

1
0

I have a scatterplot with different series of points and I need to figure out a way to draw each point separately in a different Z order. This will acheive “layering” of the points based on some metadata criteria.

The main issue to solve here is as follows. Each series can have “highlighted” points (outlined in blue on the chart, uses SciChart point selection) and “selected” points (denoted by a star point marker) which are tied to a selection in a grid. Any point in any of the series can be Highlighted and/or Selected. I need the the non-selected and non-highlighted points to be drawn first, then the selected points, then the highlighted points. This would guarantee that the highlighted points are always drawn on top of all others, and the selected points drawn on top of all but the highlighted.

My attempt has been to create a custom chart modifier and override OnParentSurfaceRendered. In that method I build dictionaries of points based on the metadata grouping criteria, then start with the lowest Z index group (the non-highlighted and non-selected points) draw those points, and continue up to the highest Z order group (the highlighted points).

Is there a simpler way to achieve this point layering functionality across data series?

Thanks.

Version
6.4.0.13629
  • You must to post comments
1
0

Hi Cale

In SciChart (any platform) you can’t change the z-order of points.

You can change the z-order of series (series are drawn in order in the RenderableSeries collection). Also you can use PointMetadata.IsSelected to denote points as selected and draw them differently using a PaletteProvider (see DatapointSelectionModifier docs) however the z order won’t be affected.

While it’s possible to create a CustomRenderableSeries to do three drawing passes (default points, selected, highlighted) it would be reimplementing our drawing. Far simpler to maintain three series and use the z-order of series to draw selected / highlighted points on top.

Can you instead consider grouping series logically in your app to achieve this?

  • You must to post comments
1
0

Hi Andrew!

Sorry for the late reply. Yes, ordering the series logically makes more sense to me, but given the setup we had we were curious if there was a way to layer points separately within a series.

We were able to rewrite and use ordered series to acheive the layering we wanted.

Thanks for the help!

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.