FlexChart | ComponentOne
FlexPie / WPF Doughnut Pie Chart
In This Topic
    WPF Doughnut Pie Chart
    In This Topic

    FlexPie allows you to create the doughnut Pie Chart by using the InnerRadius property.

    The inner radius is measured as a fraction of the radius of the Pie Chart.  The default value of the InnerRadius property is zero, which creates the Pie Chart. Setting this property to values greater than zero creates the Pie Chart with a hole in the middle, also known as the Doughnut Chart.

    WPF Doughnut pie chart

    The following code snippets demonstrate how to set the InnerRadius property  to create a WPF Doughnut pie chart.

    <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.InnerRadius = 0.5;