I understand that the series z-order is determined by the order in which the series are added to the chart. My problem is that I'm plotting several series of type ScatterLineSeries where one or more series have points in common such that the markers are stacked on top of each other. My goal is to allow the users to interact with the chart by clicking on the markers, but since they're stacked, the user can only click the marker of the series with the highest z-order. To resolve this, I was hoping to provide the user with some mechanism of changing the z-order at run-time so they could cycle through each series until the one they wanted was on top. Is there any way to do this, or do you have any other suggestions?
Thanks, Steve
Hello Steve,
Thank you for your post. I have been looking into the appearance that you are trying to achieve and I can suggest one of the following approaches for allowing the user to manipulate the Z order of the series:
1. You can add a XamComboEditor to your application, bind its ItemsSource to the Series collection of the XamDataChart and handle its SelectedItemChanged event. In the event handler you can get the Series collection of the XamDataChart and using the Panel.SetZIndex method, you can set the ZIndex attached property of the selected series to higher value in order to bring it on front.
2. The second approach that I can suggest is to use the XamDataChart’s Legend. You can create a DataTemplate that contains a RadioButton and assigned it to LegendItemTemplate property of the Series of the XamDataChart. You can handle the Checked event of the RadioButton and in the event handler, you can use the DataContext of the RadioButton to get the series to which the RadioButton corresponds and the XamDataChat and use the same logic as in the first approach in order to bring clicked series into view.
I have created a sample application for you that demonstrates both of the approaches that I have described.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
That Panel.SetZIndex idea worked great. It also works in the XamGeographicMap too which is also great.
Thanks!