corelibraries-devexpress-dot-xtracharts-dot-seriespointcollection-dot-addganttpoint-x28-system-dot-timespan-system-dot-datetime-system-dot-datetime-x29.md
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
public int AddGanttPoint(
TimeSpan argument,
DateTime value1,
DateTime value2
)
Public Function AddGanttPoint(
argument As TimeSpan,
value1 As Date,
value2 As Date
) As Integer
| Name | Type | Description |
|---|---|---|
| argument | TimeSpan |
The newly added series point’s argument.
| | value1 | DateTime |
The newly added series point’s first value.
| | value2 | DateTime |
The newly added series point’s second value.
|
| Type | Description |
|---|---|
| Int32 |
The position at which the new point was inserted.
|
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 TimeSpan(1, 0, 0),
new DateTime(2025, 10, 20),
new DateTime(2025, 10, 21)
);
chartControl1.Series.Add(series);
}
}
Imports DevExpress.XtraCharts
Imports DevExpress.XtraEditors
Public Class MainForm
Inherits XtraForm
Public Sub New()
Dim series As New Series("Gantt Series", ViewType.Gantt)
series.ValueScaleType = ScaleType.DateTime
Dim points As SeriesPointCollection = series.Points
Dim index As Integer = points.AddGanttPoint(
New TimeSpan(1, 0, 0),
New DateTime(2025, 10, 20),
New DateTime(2025, 10, 21)
)
chartControl1.Series.Add(series)
End Sub
End Class
See Also