DataPoint Class
An individual data point in the series.
Namespace: DevExpress.UI.Xaml.Charts
Assembly: DevExpress.UI.Xaml.Charts.v21.2.dll
NuGet Package: DevExpress.Uwp.Controls
Declaration
Related API Members
The following members return DataPoint objects:
Remarks
The DataPoint class implements the functionality of an individual data point in a series. Each point has two coordinates.
X-coordinate (the point’s argument).
Specified via the DataPoint.Argument or property, and depends on the scale type assigned to the DataPoint.ArgumentScaleType property.
Y-coordinate (the point’s value).
Specified via the DataPoint.Value property, and depends on the scale type assigned to the DataPoint.ValueScaleType property.
Note
If a point is missing the argument or value implied by the series view and scale type, it is considered empty, meaning that it isn’t drawn on the diagram, leaving a gap in the series data.
Points of a single series are stored within its Series.Data collection (represented by an instance of the DataPointCollection class). The collection provides the standard means for manipulating its items (such as adding, removing and accessing them), and each data point in it is available via the Item property of the collection, using indexer notation.
The code snippet below illustrates how to set a collection of data points in XAML.
<Charts:CartesianChart Style="{StaticResource CommonCartesianChartStyle}">
<Charts:CartesianChart.AxisX>
<Charts:AxisX x:Name="axisX"/>
</Charts:CartesianChart.AxisX>
<Charts:CartesianChart.AxisY>
<Charts:AxisY x:Name="axisY">
<Charts:AxisY.LabelOptions>
<Charts:AxisLabelOptions Pattern="{V}"/>
</Charts:AxisY.LabelOptions>
<Charts:AxisY.Title>
<Charts:AxisTitle Content="Population mid-year, millions"/>
</Charts:AxisY.Title>
</Charts:AxisY>
</Charts:CartesianChart.AxisY>
<Charts:CartesianChart.Series>
<Charts:Series x:Name="seriesErope" DisplayName="Europe">
<Charts:Series.Data>
<Charts:DataPointCollection>
<Charts:DataPoint Argument="1950" Value="546" />
<Charts:DataPoint Argument="1960" Value="605" />
<Charts:DataPoint Argument="1970" Value="656" />
<Charts:DataPoint Argument="1980" Value="694" />
<Charts:DataPoint Argument="1990" Value="721" />
<Charts:DataPoint Argument="2000" Value="730" />
<Charts:DataPoint Argument="2010" Value="728" />
<Charts:DataPoint Argument="2020" Value="721" />
<Charts:DataPoint Argument="2030" Value="704" />
<Charts:DataPoint Argument="2040" Value="680" />
<Charts:DataPoint Argument="2050" Value="650" />
</Charts:DataPointCollection>
</Charts:Series.Data>
</Charts:Series>
</Charts:CartesianChart.Series>
</Charts:CartesianChart>
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>