SeriesPointCollection.AddGanttPoint(TimeOnly, DateTime, DateTime) Method
Adds a point with the specified argument and values required to plot a series with a Gantt series view.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v25.2.dll
NuGet Package: DevExpress.Charts
Declaration
Parameters
| Name | Type | Description |
|---|---|---|
| argument | TimeOnly | The new series point’s argument. |
| value1 | DateTime | The new series point’s first value. |
| value2 | DateTime | The new series point’s second value. |
Returns
| Type | Description |
|---|---|
| Int32 | The position at which the new point was inserted. |
Remarks
The following code snippet adds a Gantt series point:
using DevExpress.XtraCharts;
using DevExpress.XtraEditors;
public class MainForm : XtraForm {
public MainForm() {
Series series = new Series("Gantt Series", ViewType.Gantt);
series.ValueScaleType = ScaleType.DateTime;
SeriesPointCollection points = series.Points;
int index = points.AddGanttPoint(
new TimeOnly(8, 0, 0),
new DateTime(2023, 10, 20, 8, 0, 0),
new DateTime(2023, 10, 25, 17, 0, 0)
);
chartControl1.Series.Add(series);
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;
diagram.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Hour;
}
}
See Also