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

Placing trendline under it series

Thread ID:





141695 Dec 28,2018 04:56 AM UTC Dec 31,2018 07:39 AM UTC WPF 1
Tags: Chart
Asked On December 28, 2018 04:56 AM UTC

Hello, Syncfusion team!
Got one question for you. How to place trendline under it lineseries?
By default it lies over it basic line and overlays it if they match. It spoils ability of segment drag and drop lineseries in points where trendline and lineseries match.

Best regards, Ivan.

Muneesh Kumar G [Syncfusion]
Replied On December 31, 2018 07:39 AM UTC

Hi Ivan, 
Greetings from Syncfusion, we have analyzed your requirement and you can achieve this by extending LineSeries, overriding CreateSegments method then setting ZIndex for line segment visual as per the below code snippet.  
Code snippet 
public class CustomLineSeries :LineSeries 
        public override void CreateSegments() 
            foreach (var segment in Segments) 
                Canvas.SetZIndex(segment.GetRenderedVisual(), 100); 
           <local:CustomLineSeries XBindingPath="XValue" StrokeThickness="5" 
                              YBindingPath="YValue" ItemsSource="{Binding Data}"> 
                    <chart:Trendline /> 
We have prepared a sample based on this, please find the sample from the following location.  
Hope this helps.  
Muneesh Kumar G. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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
Live Chat Icon