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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Placing trendline under it series

Thread ID:

Created:

Updated:

Platform:

Replies:

141695 Dec 28,2018 04:56 AM UTC Dec 31,2018 07:39 AM UTC WPF 1
loading
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() 
        { 
            base.CreateSegments(); 
 
            foreach (var segment in Segments) 
            { 
                Canvas.SetZIndex(segment.GetRenderedVisual(), 100); 
            } 
        } 
    } 
 
           <local:CustomLineSeries XBindingPath="XValue" StrokeThickness="5" 
                              YBindingPath="YValue" ItemsSource="{Binding Data}"> 
                <local:CustomLineSeries.Trendlines> 
                    <chart:Trendline /> 
                </local:CustomLineSeries.Trendlines> 
            </local:CustomLineSeries> 
 
We have prepared a sample based on this, please find the sample from the following location.  
 
 
Screenshot:  
 
 
Hope this helps.  
 
Thanks, 
Muneesh Kumar G. 
 


CONFIRMATION

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

;