PointData(DateTime) Constructor
In This Article
Initializes a new instance of the PointData class with specified settings.
Namespace: DevExpress.WinUI.Charts
Assembly: DevExpress.WinUI.Charts.v23.2.dll
NuGet Package: DevExpress.WinUI
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
argument | Date |
The point’s Date |
#Remarks
The following code adds an empty point with a DateTime argument to a Cartesian chart. The chart shows empty points as gaps in series data:
<Charts:CartesianChart x:Name="chart">
<!--...-->
</Charts:CartesianChart>
public MainWindow() {
this.InitializeComponent();
// Create a series:
Series series = new Series();
// Specify the series view:
series.View = new PointSeriesView();
// Create a point collection and assign it to the series:
PointDataCollection pointCollection = new PointDataCollection();
pointCollection.ArgumentScaleType = ScaleType.DateTime;
pointCollection.ValueScaleType = ScaleType.DateTime;
series.Data = pointCollection;
// Add points to the series:
pointCollection.Add(new PointData(new DateTime(2022, 01, 01), new DateTime(2020, 02, 02)));
pointCollection.Add(new PointData(new DateTime(2022, 01, 02))); // This point is empty.
pointCollection.Add(new PointData(new DateTime(2022, 01, 03), new DateTime(2020, 01, 02)));
// Add other points.
// Add the series to the chart:
chart.Series.Add(series);
// Specify x-axis settings:
chart.AxisX = new AxisX {
DateTimeMeasureUnit = DateTimeMeasureUnit.Day,
DateTimeGridAlignment = DateTimeMeasureUnit.Day,
SideMargins = 0.01,
GridSpacingAuto = false,
GridSpacing = 1
};
}
See Also