Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Series.ErrorBars Property

Provides access to a collection of error bars for the series.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v21.2.Core.dll

Declaration

ErrorBarsCollection ErrorBars { get; }

Property Value

Type Description
ErrorBarsCollection

A collection of error bars.

Remarks

Note

The ErrorBars property has no effect on the visual appearance of a chart when the document is loaded in the SpreadsheetControl. However, the property can be accessed in code, exported in supported formats and visualized in Microsoft Excel.

Example

The code sample below creates error bars for a line chart (the result is opened in Microsoft Excel):

chart with error bars

using (var workbook = new Workbook()) 
{
    workbook.LoadDocument("..\\..\\workbook.xlsx");
    var worksheet = workbook.Worksheets[0];

    // Create a chart and specify its location.
    Chart chart = worksheet.Charts.Add(ChartType.LineMarker,worksheet["A1:B13"]);
    chart.TopLeftCell = worksheet.Cells["E2"];
    chart.BottomRightCell = worksheet.Cells["K14"];
    chart.Legend.Visible = false;

    // Create an error bar
    ErrorBarsOptions errorBar = chart.Series[0].ErrorBars.Add(ErrorBarType.Both);
    errorBar.NoEndCap = true;

    // Specify the error type and value
    errorBar.ValueType = ErrorBarValueType.Percentage;
    errorBar.Value = 10;
    workbook.SaveDocument("..\\..\\Result.xlsx");
}
See Also