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 remove the blended color effect in multiple line series of SfChart?

Platform: WPF |
Control: SfChart |
Published Date: May 21, 2019 |
Last Revised Date: May 21, 2019

You can remove the blended color effect in multiple line series by extending LineSeries and setting RenderOptions.EdgeMode to Aliased for rendered visual in the CreateSegments method.

 

XAML:

<chart:SfChart.Series>
          <local:LineSeriesExt XBindingPath="SportName" YBindingPath="Interest" 
                                          Label="Series 1" ItemsSource="{Binding Data}" Interior="Blue"/>
           <local:LineSeriesExt XBindingPath="SportName" YBindingPath="Interest" 
                                          Label="Series 2" ItemsSource="{Binding Data}" Interior="Yellow"/>
</chart:SfChart.Series>

 

C#:

public class LineSeriesExt : LineSeries
{
        public override void CreateSegments()
        {
            base.CreateSegments();
 
            foreach (Syncfusion.UI.Xaml.Charts. LineSegment segment in Segments)
            {
                RenderOptions.SetEdgeMode((segment.GetRenderedVisual() as Line), EdgeMode.Aliased);
            }
        }
}

 

Note:

To avoid this workaround, you can use FastLineBitmapSeries, because it removes the blended color effect by default.

With blended effect:

LineSeries with blended effect. Without blended effect:

LineSeries without blended effect.

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
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