aspose.cells

Class ErrorBar

Represents error bar of data series.

Example:

$workbook = new cells\Workbook();
$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");
 
$chartIndex = $workbook->getWorksheets()->get(0)->getCharts()->add(cells\ChartType::COLUMN, 11, 0, 27, 10);
 
$chart = $workbook->getWorksheets()->get(0)->getCharts()->get($chartIndex);
$chart->getNSeries()->add("A1:B4", true);
 
$chart->getNSeries()->setCategoryData("C1:C4");

for ($i = 0; $i < $chart->getNSeries()->getCount(); $i++)
{
    $aseries = $chart->getNSeries()->get($i);
    $aseries->getYErrorBar()->setDisplayType(cells\ErrorBarDisplayType::MINUS);
    $aseries->getYErrorBar()->setType(cells\ErrorBarType::FIXED_VALUE);
    $aseries->getYErrorBar()->setAmount(5);
}

Property Getters/Setters Summary
functiongetAmount()
function
setAmount(value)
           Represents amount of error bar. The amount must be greater than or equal to zero.
functiongetBeginArrowLength()
function
           Specifies the length of the arrowhead for the begin of a line. The value of the property is MsoArrowheadLength integer constant.
functiongetBeginArrowWidth()
function
           Specifies the width of the arrowhead for the begin of a line. The value of the property is MsoArrowheadWidth integer constant.
functiongetBeginType()
function
           Specifies an arrowhead for the begin of a line. The value of the property is MsoArrowheadStyle integer constant.
functiongetCapType()
function
setCapType(value)
           Specifies the ending caps. The value of the property is LineCapType integer constant.
functiongetColor()
function
setColor(value)
           Represents the com.aspose.cells.Color of the line.
functiongetCompoundType()
function
           Specifies the compound line type The value of the property is MsoLineStyle integer constant.
functiongetDashType()
function
           Specifies the dash line type The value of the property is MsoLineDashStyle integer constant.
functiongetDisplayType()
function
           Represents error bar display type. The value of the property is ErrorBarDisplayType integer constant.
functiongetEndArrowLength()
function
           Specifies the length of the arrowhead for the end of a line. The value of the property is MsoArrowheadLength integer constant.
functiongetEndArrowWidth()
function
           Specifies the width of the arrowhead for the end of a line. The value of the property is MsoArrowheadWidth integer constant.
functiongetEndType()
function
setEndType(value)
           Specifies an arrowhead for the end of a line. The value of the property is MsoArrowheadStyle integer constant.
functiongetFormattingType()
function
           Gets or sets format type. The value of the property is ChartLineFormattingType integer constant.
functiongetGradientFill()
Represents gradient fill.
functionisAuto()
function
setAuto(value)
           Indicates whether this line style is auto assigned.
functionisAutomaticColor()
Indicates whether the color of line is automatic assigned.
functionisVisible()
function
setVisible(value)
           Represents whether the line is visible.
functiongetJoinType()
function
           Specifies the joining caps. The value of the property is LineJoinType integer constant.
functiongetMinusValue()
function
           Represents negative error amount when error bar type is Custom.
functiongetPlusValue()
function
           Represents positive error amount when error bar type is Custom.
functiongetShowMarkerTTop()
function
           Indicates if formatting error bars with a T-top.
functiongetStyle()
function
setStyle(value)
           Represents the style of the line. The value of the property is LineType integer constant.
functiongetThemeColor()
function
           Gets and sets the theme color.
functiongetTransparency()
function
           Returns or sets the degree of transparency of the line as a value from 0.0 (opaque) through 1.0 (clear).
functiongetType()
function
setType(value)
           Represents error bar amount type. The value of the property is ErrorBarType integer constant.
functiongetWeight()
function
setWeight(value)
           Gets or sets the WeightType of the line. The value of the property is WeightType integer constant.
functiongetWeightPt()
function
           Gets or sets the weight of the line in unit of points.
functiongetWeightPx()
function
           Gets or sets the weight of the line in unit of pixels.
 

    • Property Getters/Setters Detail

      • getType/setType : Number 

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

        Example:

        $workbook = new cells\Workbook();
        $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");
         
        $chartIndex = $workbook->getWorksheets()->get(0)->getCharts()->add(cells\ChartType::COLUMN, 11, 0, 27, 10);
        $chart = $workbook->getWorksheets()->get(0)->getCharts()->get($chartIndex);
        $chart->getNSeries()->add("A1:B4", true);
        
        $chart->getNSeries()->setCategoryData("C1:C4");
        
        $count = (int)"".$chart->getNSeries()->getCount();
        for ($i = 0; $i < $count; $i++)
        {
            $aseries = $chart->getNSeries()->get($i);
            //Sets custom error bar type
            $aseries->getYErrorBar()->setDisplayType(cells\ErrorBarDisplayType::MINUS);
            $aseries->getYErrorBar()->setType(cells\ErrorBarType::CUSTOM);
            $aseries->getYErrorBar()->setPlusValue("=Sheet1!A1");
            $aseries->getYErrorBar()->setMinusValue("=Sheet1!A2");
        }
      • getDisplayType/setDisplayType : Number 

        function getDisplayType() / function setDisplayType(value)
        
        Represents error bar display type. The value of the property is ErrorBarDisplayType integer constant.
      • getAmount/setAmount : Number 

        function getAmount() / function setAmount(value)
        
        Represents amount of error bar. The amount must be greater than or equal to zero.
      • getShowMarkerTTop/setShowMarkerTTop : boolean 

        function getShowMarkerTTop() / function setShowMarkerTTop(value)
        
        Indicates if formatting error bars with a T-top.
      • getPlusValue/setPlusValue : String 

        function getPlusValue() / function setPlusValue(value)
        
        Represents positive error amount when error bar type is Custom.
      • getMinusValue/setMinusValue : String 

        function getMinusValue() / function setMinusValue(value)
        
        Represents negative error amount when error bar type is Custom.
      • getCompoundType/setCompoundType : Number 

        function getCompoundType() / function setCompoundType(value)
        
        Specifies the compound line type The value of the property is MsoLineStyle integer constant.
      • getDashType/setDashType : Number 

        function getDashType() / function setDashType(value)
        
        Specifies the dash line type The value of the property is MsoLineDashStyle integer constant.
      • getCapType/setCapType : Number 

        function getCapType() / function setCapType(value)
        
        Specifies the ending caps. The value of the property is LineCapType integer constant.
      • getJoinType/setJoinType : Number 

        function getJoinType() / function setJoinType(value)
        
        Specifies the joining caps. The value of the property is LineJoinType integer constant.
      • getBeginType/setBeginType : Number 

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

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

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

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

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

        function getEndArrowWidth() / function setEndArrowWidth(value)
        
        Specifies the width of the arrowhead for the end of a line. The value of the property is MsoArrowheadWidth integer constant.
      • getThemeColor/setThemeColor : ThemeColor 

        function getThemeColor() / function setThemeColor(value)
        
        Gets and sets the theme color. If the foreground color is not a theme color, NULL will be returned.
      • getColor/setColor : Color 

        function getColor() / function setColor(value)
        
        Represents the com.aspose.cells.Color of the line.
      • getTransparency/setTransparency : Number 

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

        function getStyle() / function setStyle(value)
        
        Represents the style of the line. The value of the property is LineType integer constant.
      • getWeight/setWeight : Number 

        function getWeight() / function setWeight(value)
        
        Gets or sets the WeightType of the line. The value of the property is WeightType integer constant.
      • getWeightPt/setWeightPt : Number 

        function getWeightPt() / function setWeightPt(value)
        
        Gets or sets the weight of the line in unit of points.
      • getWeightPx/setWeightPx : Number 

        function getWeightPx() / function setWeightPx(value)
        
        Gets or sets the weight of the line in unit of pixels.
      • getFormattingType/setFormattingType : Number 

        function getFormattingType() / function setFormattingType(value)
        
        Gets or sets format type. The value of the property is ChartLineFormattingType integer constant.
      • isAutomaticColor : boolean 

        function isAutomaticColor()
        
        Indicates whether the color of line is automatic assigned.
      • isVisible/setVisible : boolean 

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

        function isAuto() / function setAuto(value)
        
        Indicates whether this line style is auto assigned.
      • getGradientFill : GradientFill 

        function getGradientFill()
        
        Represents gradient fill.