Legend Class

Stores chart legend settings.

Namespace: DevExpress.XamarinForms.Charts

Assembly: DevExpress.XamarinForms.Charts.dll


public class Legend :

Related API Members

The following members accept/return Legend objects:


Legend is an explanatory component that accompanies a chart diagram and identifies its most important visual elements: series, series points, constant lines and strips.

Chart Legend Elements

The Legend class properties define chart legend settings:

  • Orientation - Specifies whether legend items are positioned vertically from the top to the bottom or horizontally from the left to the right.
  • HorizontalPosition, VerticalPosition - Control the legend position within a chart.
  • Style - Provides access to legend appearance settings.
  • Visible - Allows you to show or hide a legend.

To configure a chart legend, assign a Legend object with the specified properties to the chart's Legend property.


This example shows how to add a legend to a pie chart and adjust the legend settings.

  1. To add a legend to the chart, assign a Legend object to the PieChartView.Legend property and use the following properties of this object to specify the legend orientation and position:

  2. Set the Legend.Style property to a LegendStyle object and specify the following properties of this object to configure the legend appearance:

  3. To exclude points of the chart's first series from the legend, set the VisibleInLegend property of this series to false.

Chart Legend

        <dxc:DonutSeries Data="{Binding SecuritiesByTypes}" VisibleInLegend="False"/>
        <dxc:DonutSeries Data="{Binding SecuritiesByRisk}"/>
        <dxc:Legend Orientation="LeftToRight"
                <dxc:LegendStyle BorderColor="LightGray" BorderThickness="3"
                                 MarkerSize="30" TextIndent="10"
                        <dxc:TextStyle Color="White" Size="24"/>


See Also