ErrorBar
ErrorBar class
Represents error bar of data series.
class ErrorBar extends Line;
Example
const { Workbook, ChartType, ErrorBarDisplayType, ErrorBarType } = AsposeCells;
var workbook = new Workbook();
var cells = workbook.worksheets.get(0).cells;
cells.get("a1").putValue(2);
cells.get("a2").putValue(5);
cells.get("a3").putValue(3);
cells.get("a4").putValue(6);
cells.get("b1").putValue(4);
cells.get("b2").putValue(3);
cells.get("b3").putValue(6);
cells.get("b4").putValue(7);
cells.get("C1").putValue("Q1");
cells.get("C2").putValue("Q2");
cells.get("C3").putValue("Y1");
cells.get("C4").putValue("Y2");
var chartIndex = workbook.worksheets.get(0).charts.add(ChartType.Column, 11, 0, 27, 10);
var chart = workbook.worksheets.get(0).charts.get(chartIndex);
chart.nSeries.add("A1:B4", true);
chart.nSeries.categoryData = "C1:C4";
for (var i = 0; i < chart.nSeries.count; i++) {
var aseries = chart.nSeries.get(i);
aseries.xErrorBar.displayType = ErrorBarDisplayType.Minus;
aseries.xErrorBar.type = ErrorBarType.FixedValue;
aseries.xErrorBar.amount = 5;
}
Constructors
Name | Description |
---|---|
constructor(Line) | Constructs from a parent object convertible to this. |
Properties
Property | Type | Description |
---|---|---|
type | ErrorBarType | Represents error bar amount type. |
displayType | ErrorBarDisplayType | Represents the display type of error bar. |
amount | number | Represents amount of error bar. |
showMarkerTTop | boolean | Indicates if formatting error bars with a T-top. |
plusValue | string | Represents positive error amount when error bar type is Custom. |
minusValue | string | Represents negative error amount when error bar type is Custom. |
compoundType | MsoLineStyle | Specifies the compound line type |
dashType | MsoLineDashStyle | Specifies the dash line type |
capType | LineCapType | Specifies the ending caps. |
joinType | LineJoinType | Specifies the joining caps. |
beginType | MsoArrowheadStyle | Specifies an arrowhead for the begin of a line. |
endType | MsoArrowheadStyle | Specifies an arrowhead for the end of a line. |
beginArrowLength | MsoArrowheadLength | Specifies the length of the arrowhead for the begin of a line. |
endArrowLength | MsoArrowheadLength | Specifies the length of the arrowhead for the end of a line. |
beginArrowWidth | MsoArrowheadWidth | Specifies the width of the arrowhead for the begin of a line. |
endArrowWidth | MsoArrowheadWidth | Specifies the width of the arrowhead for the end of a line. |
themeColor | ThemeColor | Gets and sets the theme color. |
color | Color | Represents the Color of the line. |
transparency | number | Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear). |
style | LineType | Represents the style of the line. |
weight | WeightType | Gets or sets the WeightType of the line. |
weightPt | number | Gets or sets the weight of the line in unit of points. |
weightPx | number | Gets or sets the weight of the line in unit of pixels. |
formattingType | ChartLineFormattingType | Gets or sets format type. |
isAutomaticColor | boolean | Readonly. Indicates whether the color of line is automatic assigned. |
isVisible | boolean | Represents whether the line is visible. |
isAuto | boolean | Indicates whether this line style is auto assigned. |
gradientFill | GradientFill | Readonly. Represents gradient fill. |
constructor(Line)
Constructs from a parent object convertible to this.
constructor(obj: Line);
Parameters:
Parameter | Type | Description |
---|---|---|
obj | Line | The parent object. |
type
Represents error bar amount type.
type : ErrorBarType;
Example
const { Workbook, ChartType, ErrorBarType } = AsposeCells;
var workbook = new Workbook();
var cells = workbook.worksheets.get(0).cells;
cells.get("a1").putValue(2);
cells.get("a2").putValue(5);
cells.get("a3").putValue(3);
cells.get("a4").putValue(6);
cells.get("b1").putValue(4);
cells.get("b2").putValue(3);
cells.get("b3").putValue(6);
cells.get("b4").putValue(7);
cells.get("C1").putValue("Q1");
cells.get("C2").putValue("Q2");
cells.get("C3").putValue("Y1");
cells.get("C4").putValue("Y2");
var chartIndex = workbook.worksheets.get(0).charts.add(ChartType.Column, 11, 0, 27, 10);
var chart = workbook.worksheets.get(0).charts.get(chartIndex);
chart.nSeries.add("A1:B4", true);
chart.nSeries.categoryData = "C1:C4";
for (var i = 0; i < chart.nSeries.count; i++) {
var aseries = chart.nSeries.get(i);
//Sets custom error bar type
aseries.xErrorBar.type = ErrorBarType.Custom;
aseries.xErrorBar.plusValue = "=Sheet1!A1";
aseries.xErrorBar.minusValue = "=Sheet1!A2";
}
displayType
Represents the display type of error bar.
displayType : ErrorBarDisplayType;
amount
Represents amount of error bar.
amount : number;
Remarks
The amount must be greater than or equal to zero.
showMarkerTTop
Indicates if formatting error bars with a T-top.
showMarkerTTop : boolean;
plusValue
Represents positive error amount when error bar type is Custom.
plusValue : string;
minusValue
Represents negative error amount when error bar type is Custom.
minusValue : string;
compoundType
Specifies the compound line type
compoundType : MsoLineStyle;
dashType
Specifies the dash line type
dashType : MsoLineDashStyle;
capType
Specifies the ending caps.
capType : LineCapType;
joinType
Specifies the joining caps.
joinType : LineJoinType;
beginType
Specifies an arrowhead for the begin of a line.
beginType : MsoArrowheadStyle;
endType
Specifies an arrowhead for the end of a line.
endType : MsoArrowheadStyle;
beginArrowLength
Specifies the length of the arrowhead for the begin of a line.
beginArrowLength : MsoArrowheadLength;
endArrowLength
Specifies the length of the arrowhead for the end of a line.
endArrowLength : MsoArrowheadLength;
beginArrowWidth
Specifies the width of the arrowhead for the begin of a line.
beginArrowWidth : MsoArrowheadWidth;
endArrowWidth
Specifies the width of the arrowhead for the end of a line.
endArrowWidth : MsoArrowheadWidth;
themeColor
Gets and sets the theme color.
themeColor : ThemeColor;
Remarks
If the foreground color is not a theme color, NULL will be returned.
color
Represents the Color of the line.
color : Color;
transparency
Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
transparency : number;
style
Represents the style of the line.
style : LineType;
weight
Gets or sets the WeightType of the line.
weight : WeightType;
weightPt
Gets or sets the weight of the line in unit of points.
weightPt : number;
weightPx
Gets or sets the weight of the line in unit of pixels.
weightPx : number;
formattingType
Gets or sets format type.
formattingType : ChartLineFormattingType;
isAutomaticColor
Readonly. Indicates whether the color of line is automatic assigned.
isAutomaticColor : boolean;
isVisible
Represents whether the line is visible.
isVisible : boolean;
isAuto
Indicates whether this line style is auto assigned.
isAuto : boolean;
gradientFill
Readonly. Represents gradient fill.
gradientFill : GradientFill;