Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to Add Error Bars to a Chart Series

The example shows how to add error bars for a chart series.

Follow the steps below to create an error bar:

  1. Call the Add method to create an error bar for a chart series.

  2. Specify the properties of the created ErrorBarsOptions object.

The code sample below creates error bars for a line chart:

chart with error bars

using DevExpress.Spreadsheet.Charts;
//... 
spreadsheetControl1.LoadDocument("Document.xlsx");

var chart1 = spreadsheetControl1.ActiveWorksheet.Charts[0];
ErrorBarsOptions errorBar = chart1.Series[0].ErrorBars.Add(ErrorBarType.Both);
//Specify the error type and value
errorBar.ValueType = ErrorBarValueType.Percentage;
errorBar.Value = 10;
//Specify error bar settings
errorBar.NoEndCap = true;