We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set the Z Index to scatter series of WPF Chart (SfChart)?

Platform: WPF |
Control: SfChart
Tags: sfchart, chart, zindex

A series is placed on a chart based on the index of the series by default. You can change the position of the appearance without changing series of the index by using the Canvas.ZIndex property of LineSeries in WPF Chart (SfChart).

In the following scenario, a Scatter series is positioned in the zeroth index, and the Line series is overlapped by the Scatter series. But, when you define the Canvas.ZIndex property, it changes the position of rendering series in the UI, but not in series index.


<chart:ScatterSeries Interior="Red" ItemsSource="{Binding Products}" XBindingPath="Name" YBindingPath="Range" />
<!--Canvas.ZIndex property is used to move front or back to the series-->
<chart:LineSeries Interior="Blue" ItemsSource="{Binding Products}" XBindingPath="Name" YBindingPath="Range" Canvas.ZIndex="-1"/>


ScatterSeries series1 = new ScatterSeries();
series1.ItemsSource = view.Products;
series1.XBindingPath = "Name";
series1.YBindingPath = "Range";
series1.Interior = Brushes.Red;
LineSeries series2 = new LineSeries();
series2.ItemsSource = view.Products;
series2.XBindingPath = "Name";
series2.YBindingPath = "Range";
series2.Interior = Brushes.Blue;
Canvas.SetZIndex(series2, -1);


WPF Chart Series with Z Index


2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile