Skip to content

DevExpress-Examples/how-to-create-a-2d-pie-donut-chart-e1648

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files to look at:

How to create a 2D Pie (Donut) chart

This example demonstrates how to create a 2D Pie chart.

Create a ChartControl and specify its ChartControl.Diagram property to a SimpleDiagram2D object.

Note that the ChartControl.Diagram is a content property. You can declare a diagram in XAML directly after a chart control's declaration without wrapping it in opening and closing ChartControl.Diagram tags.

Add a PieSeries2D object to the Diagram.Series collection.

Note that the Diagram.Series is a content property. You can declare series in XAML directly after a diagram's declaration without wrapping them in opening and closing Diagram.Series tags.

Use the following properties to bind the series to data:

The PieSeries2D.Model property allows you to change the series appearance using the built-in models. This example uses the GlarePie2DModel model.

Use the Series.LegendTextPattern property to specify how to format text that identifies series points in the legend.

The SeriesLabel.TextPattern property defines how to configure series labels' text.

The PieTotalLabel.TextPattern property allows you to specify the center label's content.

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)