Aspose::Cells::Charts::ErrorBar class

ErrorBar class

Represents error bar of data series.

class ErrorBar : public Aspose::Cells::Drawing::Line

Methods

MethodDescription
ErrorBar(ErrorBar_Impl* impl)Constructs from an implementation object.
ErrorBar(const ErrorBar& src)Copy constructor.
ErrorBar(const Line& src)Constructs from a parent object.
GetAmount()Represents amount of error bar.
GetBeginArrowLength()Specifies the length of the arrowhead for the begin of a line.
GetBeginArrowWidth()Specifies the width of the arrowhead for the begin of a line.
GetBeginType()Specifies an arrowhead for the begin of a line.
GetCapType()Specifies the ending caps.
GetColor()Represents the System.Drawing.Color of the line.
GetCompoundType()Specifies the compound line type.
GetDashType()Specifies the dash line type.
GetDisplayType()Represents error bar display type.
GetEndArrowLength()Specifies the length of the arrowhead for the end of a line.
GetEndArrowWidth()Specifies the width of the arrowhead for the end of a line.
GetEndType()Specifies an arrowhead for the end of a line.
GetFormattingType()Gets or sets format type.
GetGradientFill()Represents gradient fill.
GetJoinType()Specifies the joining caps.
GetMinusValue()Represents negative error amount when error bar type is Custom.
GetPlusValue()Represents positive error amount when error bar type is Custom.
GetShowMarkerTTop()Indicates if formatting error bars with a T-top.
GetStyle()Represents the style of the line.
GetThemeColor()Gets and sets the theme color.
GetTransparency()Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
GetType()Represents error bar amount type.
GetWeight()Gets or sets the WeightType of the line.
GetWeightPt()Gets or sets the weight of the line in unit of points.
GetWeightPx()Gets or sets the weight of the line in unit of pixels.
IsAuto()Indicates whether this line style is auto assigned.
IsAutomaticColor()Indicates whether the color of line is automatic assigned.
IsNull() constChecks whether the implementation object is nullptr.
IsVisible()Represents whether the line is visible.
Line(Line_Impl* impl)Constructs from an implementation object.
Line(const Line& src)Copy constructor.
explicit operator bool() constoperator bool()
operator=(const ErrorBar& src)operator=
operator=(const Line& src)operator=
SetAmount(double value)Represents amount of error bar.
SetBeginArrowLength(MsoArrowheadLength value)Specifies the length of the arrowhead for the begin of a line.
SetBeginArrowWidth(MsoArrowheadWidth value)Specifies the width of the arrowhead for the begin of a line.
SetBeginType(MsoArrowheadStyle value)Specifies an arrowhead for the begin of a line.
SetCapType(LineCapType value)Specifies the ending caps.
SetColor(const Aspose::Cells::Color& value)Represents the System.Drawing.Color of the line.
SetCompoundType(MsoLineStyle value)Specifies the compound line type.
SetDashType(MsoLineDashStyle value)Specifies the dash line type.
SetDisplayType(ErrorBarDisplayType value)Represents error bar display type.
SetEndArrowLength(MsoArrowheadLength value)Specifies the length of the arrowhead for the end of a line.
SetEndArrowWidth(MsoArrowheadWidth value)Specifies the width of the arrowhead for the end of a line.
SetEndType(MsoArrowheadStyle value)Specifies an arrowhead for the end of a line.
SetFormattingType(ChartLineFormattingType value)Gets or sets format type.
SetIsAuto(bool value)Indicates whether this line style is auto assigned.
SetIsVisible(bool value)Represents whether the line is visible.
SetJoinType(LineJoinType value)Specifies the joining caps.
SetMinusValue(const U16String& value)Represents negative error amount when error bar type is Custom.
SetMinusValue(const char16_t* value)Represents negative error amount when error bar type is Custom.
SetPlusValue(const U16String& value)Represents positive error amount when error bar type is Custom.
SetPlusValue(const char16_t* value)Represents positive error amount when error bar type is Custom.
SetShowMarkerTTop(bool value)Indicates if formatting error bars with a T-top.
SetStyle(LineType value)Represents the style of the line.
SetThemeColor(const ThemeColor& value)Gets and sets the theme color.
SetTransparency(double value)Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
SetType(ErrorBarType value)Represents error bar amount type.
SetWeight(WeightType value)Gets or sets the WeightType of the line.
SetWeightPt(double value)Gets or sets the weight of the line in unit of points.
SetWeightPx(double value)Gets or sets the weight of the line in unit of pixels.
~ErrorBar()Destructor.
~Line()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
Workbook workbook;
Cells cells = workbook.GetWorksheets().Get(0).GetCells();
cells.Get(u"a1").PutValue(2);
cells.Get(u"a2").PutValue(5);
cells.Get(u"a3").PutValue(3);
cells.Get(u"a4").PutValue(6);
cells.Get(u"b1").PutValue(4);
cells.Get(u"b2").PutValue(3);
cells.Get(u"b3").PutValue(6);
cells.Get(u"b4").PutValue(7);

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

int chartIndex = workbook.GetWorksheets().Get(0).GetCharts().Add(ChartType::Column, 11, 0, 27, 10);

Chart chart = workbook.GetWorksheets().Get(0).GetCharts().Get(chartIndex);
chart.GetNSeries().Add(u"A1:B4", true);

chart.GetNSeries().SetCategoryData(u"C1:C4");

for (int i = 0; i < chart.GetNSeries().GetCount(); i++)
{
    Series aseries = chart.GetNSeries().Get(i);
    aseries.GetYErrorBar().SetDisplayType(ErrorBarDisplayType::Minus);
    aseries.GetYErrorBar().SetType(ErrorBarType::FixedValue);
    aseries.GetYErrorBar().SetAmount(5);
}
Aspose::Cells::Cleanup();

See Also