public class ErrorBar extends Line
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);
}
| Modifier and Type | Method and Description |
|---|---|
double |
getAmount()
Represents amount of error bar.
|
int |
getDisplayType()
Represents the display type of error bar.
|
java.lang.String |
getMinusValue()
Represents negative error amount when error bar type is Custom.
|
java.lang.String |
getPlusValue()
Represents positive error amount when error bar type is Custom.
|
boolean |
getShowMarkerTTop()
Indicates if formatting error bars with a T-top.
|
int |
getType()
Represents error bar amount type.
|
void |
setAmount(double value)
Represents amount of error bar.
|
void |
setDisplayType(int value)
Represents the display type of error bar.
|
void |
setMinusValue(java.lang.String value)
Represents negative error amount when error bar type is Custom.
|
void |
setPlusValue(java.lang.String value)
Represents positive error amount when error bar type is Custom.
|
void |
setShowMarkerTTop(boolean value)
Indicates if formatting error bars with a T-top.
|
void |
setType(int value)
Represents error bar amount type.
|
getBeginArrowLength, getBeginArrowWidth, getBeginType, getCapType, getColor, getCompoundType, getDashType, getEndArrowLength, getEndArrowWidth, getEndType, getFormattingType, getGradientFill, getJoinType, getStyle, getThemeColor, getTransparency, getWeight, getWeightPt, getWeightPx, isAuto, isAutomaticColor, isVisible, setAuto, setBeginArrowLength, setBeginArrowWidth, setBeginType, setCapType, setColor, setCompoundType, setDashType, setEndArrowLength, setEndArrowWidth, setEndType, setFormattingType, setJoinType, setStyle, setThemeColor, setTransparency, setVisible, setWeight, setWeightPt, setWeightPxpublic int getType()
See ErrorBarType.
Example
Workbook wb = new Workbook("chart.xlsx");
Chart chart = wb.getWorksheets().get(0).getCharts().get(0);
Series aseries = chart.getNSeries().get(0);
//Sets custom error bar type
aseries.getYErrorBar().setType(ErrorBarType.CUSTOM);
aseries.getYErrorBar().setPlusValue("=Sheet1!A1");
aseries.getYErrorBar().setMinusValue("=Sheet1!A2");
public void setType(int value)
See ErrorBarType.
public int getDisplayType()
See ErrorBarDisplayType.
public void setDisplayType(int value)
See ErrorBarDisplayType.
public double getAmount()
Remarks
The amount must be greater than or equal to zero.public void setAmount(double value)
Remarks
The amount must be greater than or equal to zero.public boolean getShowMarkerTTop()
public void setShowMarkerTTop(boolean value)
public java.lang.String getPlusValue()
public void setPlusValue(java.lang.String value)
public java.lang.String getMinusValue()
public void setMinusValue(java.lang.String value)
See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.