PieChartDataAdapter Class
The data adapter that provides data to generate Pie chart items.
Namespace: DevExpress.Xpf.Map
Assembly: DevExpress.Xpf.Map.v19.1.dll
Declaration
[PieSourceCustomBindingProperties]
public class PieChartDataAdapter :
ChartDataSourceAdapter
Example
To automatically generate pie chart items from a datasource do the following.
- Create a
PieChartDataAdapter
object and assign it to the VectorLayer.Data property. - Bind a data source to the DataSourceAdapterBase.DataSource property of the object.
- Specify mappings to assign data fields to pie segment properties. To do this, specify the MapItemMappingInfoBase.Latitude, MapItemMappingInfoBase.Longitude, MapPieMappingInfo.SegmentValue and MapPieMappingInfo.SegmentId properties of the MapPieMappingInfo object assigned to the PieChartDataAdapter.Mappings property.
- Specify the ChartDataSourceAdapter.ItemIdDataMember property to group generated pie segments to pie charts.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/wpf-mapcontrol-getting-started-lesson-3-add-analytical-data-to-a-geographical-map-t177876.
<dxm:VectorLayer.Data>
<dxm:PieChartDataAdapter DataSource="{Binding Source={StaticResource dataProvider}, XPath=Table1}"
ItemIdDataMember="Country" ItemMinSize="20" ItemMaxSize="60">
<dxm:PieChartDataAdapter.MeasureRules>
<dxm:MeasureRules RangeStops="1 10 20 30 40"/>
</dxm:PieChartDataAdapter.MeasureRules>
<dxm:PieChartDataAdapter.AttributeMappings>
<dxm:MapItemAttributeMapping Member="Name" Name="Name"/>
</dxm:PieChartDataAdapter.AttributeMappings>
<dxm:PieChartDataAdapter.Mappings>
<dxm:MapPieMappingInfo Latitude="CapitalLat" Longitude="CapitalLon"
SegmentId="MedalClass" SegmentValue="Quantity"/>
</dxm:PieChartDataAdapter.Mappings>
</dxm:PieChartDataAdapter>
</dxm:VectorLayer.Data>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the PieChartDataAdapter class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.