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

ErrorBarsOptions Interface

Contains options for a chart series error bar.

Namespace: DevExpress.Spreadsheet.Charts

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

Declaration

public interface ErrorBarsOptions :
    ShapeFormat,
    ShapeFormatBase

Remarks

Note

The ErrorBarsOptions 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