Skip to main content
All docs
V25.2
  • SeriesPointCollection.AddGanttPoint(DateTime, TimeOnly, TimeOnly) 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

    public int AddGanttPoint(
        DateTime argument,
        TimeOnly value1,
        TimeOnly value2
    )

    Parameters

    Name Type Description
    argument DateTime

    The new series point’s argument.

    value1 TimeOnly

    The new series point’s first value.

    value2 TimeOnly

    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 DateTime(2023, 10, 20, 8, 0, 0),
          new TimeOnly(8, 0, 0),
          new TimeOnly(17, 0, 0)
        );
        chartControl1.Series.Add(series);
      }
    }
    
    See Also