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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Need to combine multiple line series to single legend item

Thread ID:





151296 Feb 6,2020 06:14 AM UTC Feb 7,2020 08:55 AM UTC WPF 1
Tags: SfChart
Ranjithkumar caliaperoumal
Asked On February 6, 2020 06:14 AM UTC

I want to combine multiple line series to single legend item which has same label name.

Lavanya Anaimuthu [Syncfusion]
Replied On February 7, 2020 08:55 AM UTC

Hi Ranjithkumar caliaperoumal,  
Greetings from Syncfusion.  
Query 1: How to combine multiple line series to map under one legenditem?  
You can enable one legend item by setting VisibilityOnLegend as Visible for primary series and collapsed the VisibilityOnLegend for other series and binding the first series visibility to other IsSeriesVisible property as per in the below code snippet.  
Code Snippet [Xaml]:  
                <syncfusion:ChartLegend CheckBoxVisibility="Visible" ToggleSeriesVisibility="True"/>  
<syncfusion:LineSeries x:Name="series1" ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue" Label="Series1" VisibilityOnLegend="Visible" />  
                <syncfusion:LineSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue1" Label="Series2" VisibilityOnLegend="Collapsed" IsSeriesVisible="{Binding ElementName=series1, Path=IsSeriesVisible}"/>  
                <syncfusion:LineSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue2" Label="Series3" VisibilityOnLegend="Collapsed" IsSeriesVisible="{Binding ElementName=series1, Path=IsSeriesVisible}"/>  
And we have prepared a sample based on your requirement and download the sample from below link.  
Lavanya A. 


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