Skip to main content
All docs
V25.2
  • SeriesPointCollection.AddGanttPoint(String, DateOnly, DateOnly) 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(
        string argument,
        DateOnly value1,
        DateOnly value2
    )

    Parameters

    Name Type Description
    argument String

    The new series point’s argument.

    value1 DateOnly

    The new series point’s first value.

    value2 DateOnly

    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(
          "Task 1",
          new DateOnly(2023, 10, 20),
          new DateOnly(2023, 10, 25)
        );
        chartControl1.Series.Add(series);
      }
    }
    
    See Also