ErrorBar

ErrorBar class

Represents error bar of data series.

public class ErrorBar : Line

Properties

Name Description
Amount { get; set; } Represents amount of error bar. The amount must be greater than and equal to zero.
BeginArrowLength { get; set; } Specifies the length of the arrowhead for the begin of a line.
BeginArrowWidth { get; set; } Specifies the width of the arrowhead for the begin of a line.
BeginType { get; set; } Specifies an arrowhead for the begin of a line.
CapType { get; set; } Specifies the ending caps.
Color { get; set; } Represents the Color of the line.
CompoundType { get; set; } Specifies the compound line type
DashType { get; set; } Specifies the dash line type
DisplayType { get; set; } Represents error bar display type.
EndArrowLength { get; set; } Specifies the length of the arrowhead for the end of a line.
EndArrowWidth { get; set; } Specifies the width of the arrowhead for the end of a line.
EndType { get; set; } Specifies an arrowhead for the end of a line.
FormattingType { get; set; } Gets or sets format type.
GradientFill { get; } Represents gradient fill.
IsAuto { get; set; } Indicates whether this line style is auto assigned.
IsAutomaticColor { get; } Indicates whether the color of line is automatic assigned.
IsVisible { get; set; } Represents whether the line is visible.
JoinType { get; set; } Specifies the joining caps.
MinusValue { get; set; } Represents negative error amount when error bar type is Custom.
PlusValue { get; set; } Represents positive error amount when error bar type is Custom.
ShowMarkerTTop { get; set; } Indicates if formatting error bars with a T-top.
Style { get; set; } Represents the style of the line.
ThemeColor { get; set; } Gets and sets the theme color.
Transparency { get; set; } Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
Type { get; set; } Represents error bar amount type.
Weight { get; set; } Gets or sets the WeightType of the line.
WeightPt { get; set; } Gets or sets the weight of the line in unit of points.
WeightPx { get; set; } Gets or sets the weight of the line in unit of pixels.

Examples

[C#]
Workbook workbook = new Workbook();
Cells cells = workbook.Worksheets[0].Cells;
cells["a1"].PutValue(2);
cells["a2"].PutValue(5);
cells["a3"].PutValue(3);
cells["a4"].PutValue(6);
cells["b1"].PutValue(4);
cells["b2"].PutValue(3);
cells["b3"].PutValue(6);
cells["b4"].PutValue(7);

cells["C1"].PutValue("Q1");
cells["C2"].PutValue("Q2");
cells["C3"].PutValue("Y1");
cells["C4"].PutValue("Y2");

int chartIndex = excel.Worksheets[0].Charts.Add(ChartType.Column, 11, 0, 27, 10);

Chart chart = excel.Worksheets[0].Charts[chartIndex];
chart.NSeries.Add("A1:B4", true);

chart.NSeries.CategoryData = "C1:C4";

for(int i = 0; i < chart.NSeries.Count; i ++)
{
	ASeries aseries = chart.NSeries[i];
	aseries.YErrorBar.DisplayType = ErrorBarDisplayType.Minus;
	aseries.YErrorBar.Type = ErrorBarType.FixedValue;
	aseries.YErrorBar.Amount = 5;
}

[Visual Basic]
Dim workbook As Workbook =  New Workbook() 
Dim cells As Cells =  workbook.Worksheets(0).Cells 
cells("a1").PutValue(2)
cells("a2").PutValue(5)
cells("a3").PutValue(3)
cells("a4").PutValue(6)
cells("b1").PutValue(4)
cells("b2").PutValue(3)
cells("b3").PutValue(6)
cells("b4").PutValue(7)

cells("C1").PutValue("Q1")
cells("C2").PutValue("Q2")
cells("C3").PutValue("Y1")
cells("C4").PutValue("Y2")

Dim chartIndex As Integer =  excel.Worksheets(0).Charts.Add(ChartType.Column,11,0,27,10) 

Dim chart As Chart =  excel.Worksheets(0).Charts(chartIndex) 
chart.NSeries.Add("A1:B4", True)

chart.NSeries.CategoryData = "C1:C4"

Dim i As Integer
For  i = 0 To chart.NSeries.Count - 1
Dim aseries As ASeries =  chart.NSeries(i) 
aseries.YErrorBar.DisplayType = ErrorBarDisplayType.Minus
aseries.YErrorBar.Type = ErrorBarType.FixedValue
aseries.YErrorBar.Amount = 5
Next

See Also