SeriesPoint3DDataSourceAdapter.XArgumentDataMember Property
Gets or sets the name of the data member whose values are used as X argument values of series points.
Namespace: DevExpress.Xpf.Charts
Assembly:
DevExpress.Xpf.Charts.v24.1.dll
NuGet Package:
DevExpress.Wpf.Charts
Declaration
public string XArgumentDataMember { get; set; }
Public Property XArgumentDataMember As String
Property Value
Type |
Description |
String |
The data member name.
|
Example
In this example the manually created series will be populated with randomly generated points.
The following classes and properties are used in this example.
Namespace Bar3DChart
Public Class Point
Private privateX As Double
Public Property X() As Double
Get
Return privateX
End Get
Private Set(ByVal value As Double)
privateX = value
End Set
End Property
Private privateY As Double
Public Property Y() As Double
Get
Return privateY
End Get
Private Set(ByVal value As Double)
privateY = value
End Set
End Property
Private privateZ As Double
Public Property Z() As Double
Get
Return privateZ
End Get
Private Set(ByVal value As Double)
privateZ = value
End Set
End Property
Public Sub New(ByVal x As Double, ByVal y As Double, ByVal z As Double)
Me.X = x
Me.Y = y
Me.Z = z
End Sub
End Class
End Namespace
<dxc:Series3DStorage>
<dxc:Series3D DisplayName="Random Data"
CrosshairLabelPattern="({X:F2}; {Y:F2}): {V:F2}">
<dxc:SeriesPoint3DDataSourceAdapter DataSource="{Binding Path=DataPoints}"
XArgumentDataMember="X"
YArgumentDataMember="Y"
ValueDataMember="Z" />
<dxc:Series3D.View>
<dxc:Bar3DSeriesView BarSize="10, 10"
EqualBarSize="True">
<dxc:Bar3DSeriesView.BarModel>
<dxc:Bar3DBoxPointModel ShowFacets="False" />
</dxc:Bar3DSeriesView.BarModel>
<dxc:Bar3DSeriesView.Colorizer>
<dxc:RangeColorizer3D ApproximateColors="True"
RangeStops="0 50 100 150 200">
<dxc:RangeColorizer3D.Palette>
<dxc:CustomPalette>
<dxc:CustomPalette.Colors>
<Color>#ff5a19</Color>
<Color>#fead2d</Color>
<Color>#e5e335</Color>
<Color>#ace45c</Color>
<Color>#6ec95c</Color>
</dxc:CustomPalette.Colors>
</dxc:CustomPalette>
</dxc:RangeColorizer3D.Palette>
</dxc:RangeColorizer3D>
</dxc:Bar3DSeriesView.Colorizer>
</dxc:Bar3DSeriesView>
</dxc:Series3D.View>
</dxc:Series3D>
</dxc:Series3DStorage>
Imports System
Imports System.Collections.ObjectModel
Namespace Bar3DChart
Public Class RandomDataViewModel
Public Property DataPoints() As ObservableCollection(Of Point)
Public Sub New()
Dim barsCount As Integer = 200
Dim maxValue As Integer = 200
Me.DataPoints = DataGenerator.GenerateData(barsCount, maxValue)
End Sub
End Class
Public NotInheritable Class DataGenerator
Private Sub New()
End Sub
Public Shared Function GenerateData(ByVal pointCount As Integer, ByVal maxValue As Integer) As ObservableCollection(Of Point)
Dim rand As New Random()
Dim bars As New ObservableCollection(Of Point)()
For i As Integer = 0 To pointCount - 1
Dim bar As Point
Dim x As Double = rand.NextDouble() * maxValue * 2
Dim y As Double = rand.NextDouble() * maxValue * 2
Dim z As Double = rand.NextDouble() * maxValue
bar = New Point(x, y, z)
bars.Add(bar)
Next i
Return bars
End Function
End Class
End Namespace
namespace Bar3DChart {
public class Point {
public double X { get; private set; }
public double Y { get; private set; }
public double Z { get; private set; }
public Point(double x, double y, double z) {
this.X = x;
this.Y = y;
this.Z = z;
}
}
}
using System;
using System.Collections.ObjectModel;
namespace Bar3DChart {
public class RandomDataViewModel {
public ObservableCollection<Point> DataPoints { get; set; }
public RandomDataViewModel() {
int barsCount = 200;
int maxValue = 200;
this.DataPoints = DataGenerator.GenerateData(barsCount, maxValue);
}
}
public static class DataGenerator {
public static ObservableCollection<Point> GenerateData(int pointCount, int maxValue) {
Random rand = new Random();
ObservableCollection<Point> bars = new ObservableCollection<Point>();
for (int i = 0; i < pointCount; i++) {
Point bar;
double x = rand.NextDouble() * maxValue * 2;
double y = rand.NextDouble() * maxValue * 2;
double z = rand.NextDouble() * maxValue;
bar = new Point(x, y, z);
bars.Add(bar);
}
return bars;
}
}
}
See Also