Skip to main content

PieChart Class

The Pie Chart control to plot series of data points on a pie chart area.

Namespace: DevExpress.UI.Xaml.Charts

Assembly: DevExpress.UI.Xaml.Charts.v21.2.dll

NuGet Package: DevExpress.Uwp.Controls

Declaration

[ToolboxTabName("DX.21.2: Visualization")]
public class PieChart :
    ChartBase,
    IChartViewHolder

Remarks

The PieChart class represents a visual control intended for graphical data representation. It is comprised of separate elements, such as legend, etc. To learn more about them, refer to Visual Elements.

To display a Series on a chart, it’s necessary to add this series to the collection returned by the ChartBase.Series property. Note that the PieChart control can display only series, for which Series.View is one of the PieSeriesView class descendants (e.g., PieSeriesView, DonutSeriesView, etc.).

To display series of the AreaSeriesView, LineSeriesView and other Cartesian types, use the CartesianChart control instead.

Example

The following example demonstrates how to create a simple Pie Chart with one series.

<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:PieChart"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Charts="using:DevExpress.UI.Xaml.Charts"
    x:Class="PieChart.MainPage"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

        <Charts:PieChart Margin="50" ToolTipEnabled="True">
            <Charts:Series>
                <Charts:Series.View>
                    <Charts:PieSeriesView LegendPointPattern="{}{A}"/>
                </Charts:Series.View>
                <Charts:Series.Data>
                    <Charts:DataPointCollection>
                        <Charts:DataPoint Argument="USA" Value="9.63142" />
                        <Charts:DataPoint Argument="Canada" Value="9.98467" />
                        <Charts:DataPoint Argument="Russia" Value="17.0752" />
                        <Charts:DataPoint Argument="Others" Value="81.2" />
                        <Charts:DataPoint Argument="India" Value="3.28759" />
                        <Charts:DataPoint Argument="Australia" Value="7.68685" />
                        <Charts:DataPoint Argument="Brazil" Value="8.511965" />
                        <Charts:DataPoint Argument="China" Value="9.59696" />
                    </Charts:DataPointCollection>
                </Charts:Series.Data>
            </Charts:Series>
            <Charts:PieChart.Legend>
                <Charts:Legend MaximumRowsOrColumns="4"/>
            </Charts:PieChart.Legend>
        </Charts:PieChart>

    </Grid>
</Page>

Inheritance

See Also