Articles in this section
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
};

OutputChart legend before toggle in Xamarin.Forms

Figure 1: Legend item untapped.

Chart legend after toggle in Xamarin.Forms

Figure 2: Legend item tapped/unselected, thereby, column series is invisible.

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