Hi Rex,
Thanks for contacting Syncfusion Support.
We have analyzed your query (programmatically check and uncheck legend’s check box and know the current checked and unchecked legend) and achieved it by using IsSeriesVisible property in chart series as shown in the below code,
MainWindow.xaml:
<chart:SfChart Margin="10">
<chart:SfChart.Legend>
<chart:ChartLegend CheckBoxVisibility="Visible"/>
</chart:SfChart.Legend>
<chart:LineSeries ItemsSource="{Binding Collection}" Label="Series1" XBindingPath="XValue" YBindingPath="YValue"/>
<chart:LineSeries ItemsSource="{Binding Collection}" IsSeriesVisible="False" Label="Series2" XBindingPath="XValue" YBindingPath="YValue1"/>
<chart:LineSeries ItemsSource="{Binding Collection}" Label="Series3" XBindingPath="XValue" YBindingPath="YValue2"/>
</chart:SfChart>
|
Please find the output screenshot,
We have prepared a simple sample for your reference and please downloaded from the below link,
You can refer our UG Documentation link to know more about Legend in SfChart,
Regards,
Durgadevi S