ComponentOne Xamarin.iOS Documentation
Controls / FlexChart / Features / Legend
In This Topic
    In This Topic

    FlexChart provides the option to display legend for denoting the type of data plotted on the axes. The position of legend is by default set to "Auto", which means the legend positions itself automatically depending on the real estate available on the device. This allows the chart to efficiently occupy the available space on the device.

    FlexChart allows you to set the location of the legends by setting the LegendPosition property of the legend. To hide the legend, set the LegendPosition property to None. The LegendPosition property accepts value from the ChartPositionType property. Moreover, you can set the LegendToggle property to true, which allows you to toggle the visibility of any series by clicking its corresponding legend item.

    The image below shows customized legend in the FlexChart control.

    Chart Legend

    The example uses the sample created in the Customize Appearance section.

    In Code

    Copy Code
    chart.LegendPosition = ChartPositionType.Top;
    chart.LegendStyle.Fill = UIColor.Yellow;
    chart.LegendToggle = true;