Category / Section
How to collapse the series through legend?
1 min read
Essential chart for Xamarin.Forms has support to collapse the series dynamically by tapping the respective legend item. You can enable this feature by setting the ToggleSeriesVisibility to true.
XAML
<chart:SfChart.Legend> <chart:ChartLegend ToggleSeriesVisibility="true" /> </chart:SfChart.Legend>
C#
chart.Legend = new ChartLegend() { ToggleSeriesVisibility = true };
Output
Figure 1: Legend item untapped.
Figure 2: Legend item tapped/unselected, thereby, column series is invisible.