Articles in this section
Category / Section

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

5 mins read

This article explains how to remove the blended color effect in multiple line series within WPF SfChart. By extending the LineSeries class and setting the RenderOptions.EdgeMode to Aliased for rendered visual in the CreateSegments method, you can achieve a clearer line representation.


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.

 

Output:

 

With blended effect:

LineSeries with blended effect.

Without blended effect:

LineSeries without blended effect.



Conclusion

I hope you enjoyed learning about how to remove the blended color effect in multiple line series.

You can refer to our WPF Chart’s feature tour page to know about its other groundbreaking feature representations. You can also explore our WPF Charts documentation to understand how to present and manipulate data.


For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our WPF Chart and other WPF components.


If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

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