FlexChart | ComponentOne
FlexPie / Legend
In This Topic
    Legend
    In This Topic

    FlexPie enables you to specify the position where you want to display the Legend by using the Legend property of FlexChartBase.

    The below-mentioned code snippet shows how to set the property.

    <Grid>
    
        <Chart:C1FlexPie 
            x:Name="flexPie" 
            InnerRadius="0.5"
            Offset="0.5"
            Header="Fruit Sales Data"
            Footer="2015"
            LegendOrientation="Horizontal"
            LegendPosition="Bottom"
            SelectionMode="Point" 
            SelectedItemPosition="Top"
            SelectedItemOffset="2"
            Margin="95,99,328,275" 
            Binding="April" 
            BindingName="Fruit" 
            ItemsSource="{Binding DataContext.Data}">
            <Chart:C1FlexPie.SelectionStyle>
                <Chart:ChartStyle Stroke="Red" 
                                  StrokeThickness="2"/>
            </Chart:C1FlexPie.SelectionStyle>
            <Chart:C1FlexPie.DataLabel>
                <Chart:PieDataLabel Content="{}{y}"/>
            </Chart:C1FlexPie.DataLabel>
        </Chart:C1FlexPie>
    </Grid>
    
    C#
    Copy Code
    flexPie.LegendOrientation = C1.Chart.Orientation.Horizontal;
    flexPie.LegendPosition = C1.Chart.Position.Bottom;