com.aspose.cells

Class ErrorBar

  • java.lang.Object
    • Line
      • com.aspose.cells.ErrorBar
public class ErrorBar 
extends Line

Represents error bar of data series.

Example:

Workbook workbook = new Workbook();
Cells cells = workbook.getWorksheets().get(0).getCells();
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");
 
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("A1:B4", true);
 
chart.getNSeries().setCategoryData("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.FIXED_VALUE);
    aseries.getYErrorBar().setAmount(5);
}

Property Getters/Setters Summary
doublegetAmount()
void
setAmount(doublevalue)
           Represents amount of error bar. The amount must be greater than and equal to zero.
intgetBeginArrowLength()
void
           Specifies the length of the arrowhead for the begin of a line. The value of the property is MsoArrowheadLength integer constant.
intgetBeginArrowWidth()
void
           Specifies the width of the arrowhead for the begin of a line. The value of the property is MsoArrowheadWidth integer constant.
intgetBeginType()
void
setBeginType(intvalue)
           Specifies an arrowhead for the begin of a line. The value of the property is MsoArrowheadStyle integer constant.
intgetCapType()
void
setCapType(intvalue)
           Specifies the ending caps. The value of the property is LineCapType integer constant.
com.aspose.cells.ColorgetColor()
void
setColor(com.aspose.cells.Colorvalue)
           Represents the com.aspose.cells.Color of the line.
intgetCompoundType()
void
setCompoundType(intvalue)
           Specifies the compound line type The value of the property is MsoLineStyle integer constant.
intgetDashType()
void
setDashType(intvalue)
           Specifies the dash line type The value of the property is MsoLineDashStyle integer constant.
intgetDisplayType()
void
setDisplayType(intvalue)
           Represents error bar display type. The value of the property is ErrorBarDisplayType integer constant.
intgetEndArrowLength()
void
           Specifies the length of the arrowhead for the end of a line. The value of the property is MsoArrowheadLength integer constant.
intgetEndArrowWidth()
void
           Specifies the width of the arrowhead for the end of a line. The value of the property is MsoArrowheadWidth integer constant.
intgetEndType()
void
setEndType(intvalue)
           Specifies an arrowhead for the end of a line. The value of the property is MsoArrowheadStyle integer constant.
intgetFormattingType()
void
           Gets or sets format type. The value of the property is ChartLineFormattingType integer constant.
GradientFillgetGradientFill()
Represents gradient fill.
booleanisAuto()
void
setAuto(booleanvalue)
           Indicates whether this line style is auto assigned.
booleanisAutomaticColor()
Indicates whether the color of line is auotmatic assigned.
booleanisVisible()
void
setVisible(booleanvalue)
           Represents whether the line is visible.
intgetJoinType()
void
setJoinType(intvalue)
           Specifies the joining caps. The value of the property is LineJoinType integer constant.
java.lang.StringgetMinusValue()
void
setMinusValue(java.lang.Stringvalue)
           Represents negative error amount when error bar type is InnerCustom.
java.lang.StringgetPlusValue()
void
setPlusValue(java.lang.Stringvalue)
           Represents positive error amount when error bar type is InnerCustom.
booleangetShowMarkerTTop()
void
setShowMarkerTTop(booleanvalue)
           Indicates if formatting error bars with a T-top.
intgetStyle()
void
setStyle(intvalue)
           Represents the style of the line. The value of the property is LineType integer constant.
doublegetTransparency()
void
setTransparency(doublevalue)
           Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
intgetType()
void
setType(intvalue)
           Represents error bar amount type. The value of the property is ErrorBarType integer constant.
intgetWeight()
void
setWeight(intvalue)
           Gets or sets the WeightType of the line. The value of the property is WeightType integer constant.
doublegetWeightPt()
void
setWeightPt(doublevalue)
           Gets or sets the weight of the line in unit of points.
doublegetWeightPx()
void
setWeightPx(doublevalue)
           Gets or sets the weight of the line in uni of pixels.
 

    • Property Getters/Setters Detail

      • getType/setType

        public int getType() / public void setType(int value)
        
        Represents error bar amount type. The value of the property is ErrorBarType integer constant.

        Example:

        //Sets custom error bar type
        Workbook workbook = new Workbook();
        Cells cells = workbook.getWorksheets().get(0).getCells();
        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");
         
        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("A1:B4", true);
         
        chart.getNSeries().setCategoryData("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.CUSTOM);
            aseries.getYErrorBar().setPlusValue("=Sheet1!A1");
            aseries.getYErrorBar().setMinusValue("=Sheet1!A2");
        }
      • getDisplayType/setDisplayType

        public int getDisplayType() / public void setDisplayType(int value)
        
        Represents error bar display type. The value of the property is ErrorBarDisplayType integer constant.
      • getAmount/setAmount

        public double getAmount() / public void setAmount(double value)
        
        Represents amount of error bar. The amount must be greater than and equal to zero.
      • getShowMarkerTTop/setShowMarkerTTop

        public boolean getShowMarkerTTop() / public void setShowMarkerTTop(boolean value)
        
        Indicates if formatting error bars with a T-top.
      • getPlusValue/setPlusValue

        public java.lang.String getPlusValue() / public void setPlusValue(java.lang.String value)
        
        Represents positive error amount when error bar type is InnerCustom.
      • getMinusValue/setMinusValue

        public java.lang.String getMinusValue() / public void setMinusValue(java.lang.String value)
        
        Represents negative error amount when error bar type is InnerCustom.
      • getCompoundType/setCompoundType

        public int getCompoundType() / public void setCompoundType(int value)
        
        Specifies the compound line type The value of the property is MsoLineStyle integer constant.
      • getDashType/setDashType

        public int getDashType() / public void setDashType(int value)
        
        Specifies the dash line type The value of the property is MsoLineDashStyle integer constant.
      • getCapType/setCapType

        public int getCapType() / public void setCapType(int value)
        
        Specifies the ending caps. The value of the property is LineCapType integer constant.
      • getJoinType/setJoinType

        public int getJoinType() / public void setJoinType(int value)
        
        Specifies the joining caps. The value of the property is LineJoinType integer constant.
      • getBeginType/setBeginType

        public int getBeginType() / public void setBeginType(int value)
        
        Specifies an arrowhead for the begin of a line. The value of the property is MsoArrowheadStyle integer constant.
      • getEndType/setEndType

        public int getEndType() / public void setEndType(int value)
        
        Specifies an arrowhead for the end of a line. The value of the property is MsoArrowheadStyle integer constant.
      • getBeginArrowLength/setBeginArrowLength

        public int getBeginArrowLength() / public void setBeginArrowLength(int value)
        
        Specifies the length of the arrowhead for the begin of a line. The value of the property is MsoArrowheadLength integer constant.
      • getEndArrowLength/setEndArrowLength

        public int getEndArrowLength() / public void setEndArrowLength(int value)
        
        Specifies the length of the arrowhead for the end of a line. The value of the property is MsoArrowheadLength integer constant.
      • getBeginArrowWidth/setBeginArrowWidth

        public int getBeginArrowWidth() / public void setBeginArrowWidth(int value)
        
        Specifies the width of the arrowhead for the begin of a line. The value of the property is MsoArrowheadWidth integer constant.
      • getEndArrowWidth/setEndArrowWidth

        public int getEndArrowWidth() / public void setEndArrowWidth(int value)
        
        Specifies the width of the arrowhead for the end of a line. The value of the property is MsoArrowheadWidth integer constant.
      • getColor/setColor

        public com.aspose.cells.Color getColor() / public void setColor(com.aspose.cells.Color value)
        
        Represents the com.aspose.cells.Color of the line.
      • getTransparency/setTransparency

        public double getTransparency() / public void setTransparency(double value)
        
        Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
      • getStyle/setStyle

        public int getStyle() / public void setStyle(int value)
        
        Represents the style of the line. The value of the property is LineType integer constant.
      • getWeight/setWeight

        public int getWeight() / public void setWeight(int value)
        
        Gets or sets the WeightType of the line. The value of the property is WeightType integer constant.
      • getWeightPt/setWeightPt

        public double getWeightPt() / public void setWeightPt(double value)
        
        Gets or sets the weight of the line in unit of points.
      • getWeightPx/setWeightPx

        public double getWeightPx() / public void setWeightPx(double value)
        
        Gets or sets the weight of the line in uni of pixels.
      • getFormattingType/setFormattingType

        public int getFormattingType() / public void setFormattingType(int value)
        
        Gets or sets format type. The value of the property is ChartLineFormattingType integer constant.
      • isAutomaticColor

        public boolean isAutomaticColor()
        
        Indicates whether the color of line is auotmatic assigned.
      • isVisible/setVisible

        public boolean isVisible() / public void setVisible(boolean value)
        
        Represents whether the line is visible.
      • isAuto/setAuto

        public boolean isAuto() / public void setAuto(boolean value)
        
        Indicates whether this line style is auto assigned.
      • getGradientFill

        public GradientFill getGradientFill()
        
        Represents gradient fill.

    setType

    public voidsetType(intvalue)
    
    Represents error bar amount type. The value of the property is ErrorBarType integer constant.

    Example:

    //Sets custom error bar type
    Workbook workbook = new Workbook();
    Cells cells = workbook.getWorksheets().get(0).getCells();
    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");
     
    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("A1:B4", true);
     
    chart.getNSeries().setCategoryData("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.CUSTOM);
        aseries.getYErrorBar().setPlusValue("=Sheet1!A1");
        aseries.getYErrorBar().setMinusValue("=Sheet1!A2");
    }

    setDisplayType

    public voidsetDisplayType(intvalue)
    
    Represents error bar display type. The value of the property is ErrorBarDisplayType integer constant.

    setAmount

    public voidsetAmount(doublevalue)
    
    Represents amount of error bar. The amount must be greater than and equal to zero.

    setShowMarkerTTop

    public voidsetShowMarkerTTop(booleanvalue)
    
    Indicates if formatting error bars with a T-top.

    setPlusValue

    public voidsetPlusValue(java.lang.Stringvalue)
    
    Represents positive error amount when error bar type is InnerCustom.

    setMinusValue

    public voidsetMinusValue(java.lang.Stringvalue)
    
    Represents negative error amount when error bar type is InnerCustom.

    setCompoundType

    public voidsetCompoundType(intvalue)
    
    Specifies the compound line type The value of the property is MsoLineStyle integer constant.

    setDashType

    public voidsetDashType(intvalue)
    
    Specifies the dash line type The value of the property is MsoLineDashStyle integer constant.

    setCapType

    public voidsetCapType(intvalue)
    
    Specifies the ending caps. The value of the property is LineCapType integer constant.

    setJoinType

    public voidsetJoinType(intvalue)
    
    Specifies the joining caps. The value of the property is LineJoinType integer constant.

    setBeginType

    public voidsetBeginType(intvalue)
    
    Specifies an arrowhead for the begin of a line. The value of the property is MsoArrowheadStyle integer constant.

    setEndType

    public voidsetEndType(intvalue)
    
    Specifies an arrowhead for the end of a line. The value of the property is MsoArrowheadStyle integer constant.

    setBeginArrowLength

    public voidsetBeginArrowLength(intvalue)
    
    Specifies the length of the arrowhead for the begin of a line. The value of the property is MsoArrowheadLength integer constant.

    setEndArrowLength

    public voidsetEndArrowLength(intvalue)
    
    Specifies the length of the arrowhead for the end of a line. The value of the property is MsoArrowheadLength integer constant.

    setBeginArrowWidth

    public voidsetBeginArrowWidth(intvalue)
    
    Specifies the width of the arrowhead for the begin of a line. The value of the property is MsoArrowheadWidth integer constant.

    setEndArrowWidth

    public voidsetEndArrowWidth(intvalue)
    
    Specifies the width of the arrowhead for the end of a line. The value of the property is MsoArrowheadWidth integer constant.

    setColor

    public voidsetColor(com.aspose.cells.Colorvalue)
    
    Represents the com.aspose.cells.Color of the line.

    setTransparency

    public voidsetTransparency(doublevalue)
    
    Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).

    setStyle

    public voidsetStyle(intvalue)
    
    Represents the style of the line. The value of the property is LineType integer constant.

    setWeight

    public voidsetWeight(intvalue)
    
    Gets or sets the WeightType of the line. The value of the property is WeightType integer constant.

    setWeightPt

    public voidsetWeightPt(doublevalue)
    
    Gets or sets the weight of the line in unit of points.

    setWeightPx

    public voidsetWeightPx(doublevalue)
    
    Gets or sets the weight of the line in uni of pixels.

    setFormattingType

    public voidsetFormattingType(intvalue)
    
    Gets or sets format type. The value of the property is ChartLineFormattingType integer constant.

    setVisible

    public voidsetVisible(booleanvalue)
    
    Represents whether the line is visible.

    setAuto

    public voidsetAuto(booleanvalue)
    
    Indicates whether this line style is auto assigned.