Back to Devexpress

SeriesPointCollection.AddGanttPoint(DateTime, TimeSpan, TimeSpan) Method

corelibraries-devexpress-dot-xtracharts-dot-seriespointcollection-dot-addganttpoint-x28-system-dot-datetime-system-dot-timespan-system-dot-timespan-x29.md

latest3.0 KB
Original Source

SeriesPointCollection.AddGanttPoint(DateTime, TimeSpan, TimeSpan) 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

csharp
public int AddGanttPoint(
    DateTime argument,
    TimeSpan value1,
    TimeSpan value2
)
vb
Public Function AddGanttPoint(
    argument As Date,
    value1 As TimeSpan,
    value2 As TimeSpan
) As Integer

Parameters

NameTypeDescription
argumentDateTime

The new series point’s argument.

| | value1 | TimeSpan |

The new series point’s first value.

| | value2 | TimeSpan |

The new series point’s second value.

|

Returns

TypeDescription
Int32

The position at which the new point was inserted.

|

Remarks

The following code snippet adds a Gantt series point:

csharp
using DevExpress.XtraCharts;
using DevExpress.XtraEditors;

public class MainForm : XtraForm {
  public MainForm() {
    Series series = new Series("Gantt Series", ViewType.Gantt);
    series.ValueScaleType = ScaleType.TimeSpan;
    SeriesPointCollection points = series.Points;
    int index = points.AddGanttPoint(
      new DateTime(2025, 10, 20),
      new TimeSpan(2, 0, 0),
      new TimeSpan(3, 0, 0)
    );
    chartControl1.Series.Add(series);
  }
}
vb
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.TimeSpan
    Dim points As SeriesPointCollection = series.Points
    Dim index As Integer = points.AddGanttPoint(
      New DateTime(2025, 10, 20),
      New TimeSpan(2, 0, 0),
      New TimeSpan(3, 0, 0)
    )
    chartControl1.Series.Add(series)
  End Sub
End Class

See Also

SeriesPointCollection Class

SeriesPointCollection Members

DevExpress.XtraCharts Namespace