Skip to main content
All docs
V25.2
  • SeriesPointCollection.AddRangePoint(TimeOnly, Double, Double) Method

    Adds a point with the specified argument and values required to plot a series with a range series view.

    Namespace: DevExpress.XtraCharts

    Assembly: DevExpress.XtraCharts.v25.2.dll

    NuGet Package: DevExpress.Charts

    Declaration

    public int AddRangePoint(
        TimeOnly argument,
        double value1,
        double value2
    )

    Parameters

    Name Type Description
    argument TimeOnly

    The new series point’s argument.

    value1 Double

    The new series point’s first value.

    value2 Double

    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 Range series point:

    using DevExpress.XtraCharts;
    using DevExpress.XtraEditors;
    
    public class MainForm : XtraForm {
      public MainForm() {
        Series series = new Series("Range Series", ViewType.RangeBar);
        SeriesPointCollection points = series.Points;
        int index = points.AddRangePoint(
          new TimeOnly(12, 0, 0),
          1.0,
          2.0
        );
        chartControl1.Series.Add(series);
    
        XYDiagram diagram = (XYDiagram)chartControl1.Diagram;
        diagram.AxisX.DateTimeScaleOptions.MeasureUnit = DateTimeMeasureUnit.Hour;
      }
    }
    
    See Also