ErrorBarsOptions Interface
Contains options for a chart series error bar.
Namespace: DevExpress.Spreadsheet.Charts
Assembly: DevExpress.Spreadsheet.v21.1.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
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):
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