Articles in this section
Category / Section

How to remove the blended color effect in multiple line series of SfChart?

1 min read

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.

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied