aspose.cells

Class Series

Encapsulates the object that represents a single data series in a chart.

Example:

//Instantiating a Workbook object
$workbook = new cells\Workbook();
//Adding a new worksheet to the Excel object
$sheetIndex = $workbook->getWorksheets()->add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
$worksheet = $workbook->getWorksheets()->get($sheetIndex);
//Adding a sample value to "A1" cell
$worksheet->getCells()->get("A1")->putValue(50);
//Adding a sample value to "A2" cell
$worksheet->getCells()->get("A2")->putValue(100);
//Adding a sample value to "A3" cell
$worksheet->getCells()->get("A3")->putValue(150);
//Adding a sample value to "A4" cell
$worksheet->getCells()->get("A4")->putValue(200);
//Adding a sample value to "B1" cell
$worksheet->getCells()->get("B1")->putValue(60);
//Adding a sample value to "B2" cell
$worksheet->getCells()->get("B2")->putValue(32);
//Adding a sample value to "B3" cell
$worksheet->getCells()->get("B3")->putValue(50);
//Adding a sample value to "B4" cell
$worksheet->getCells()->get("B4")->putValue(40);
//Adding a sample value to "C1" cell as category data
$worksheet->getCells()->get("C1")->putValue("Q1");
//Adding a sample value to "C2" cell as category data
$worksheet->getCells()->get("C2")->putValue("Q2");
//Adding a sample value to "C3" cell as category data
$worksheet->getCells()->get("C3")->putValue("Y1");
//Adding a sample value to "C4" cell as category data
$worksheet->getCells()->get("C4")->putValue("Y2");
//Adding a chart to the worksheet
$chartIndex = $worksheet->getCharts()->add(cells\ChartType::COLUMN, 5, 0, 15, 5);
//Accessing the instance of the newly added chart
$chart = $worksheet->getCharts()->get($chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
$chart->getNSeries()->add("A1:B4", true);
//Setting the data source for the category data of NSeries
$chart->getNSeries()->setCategoryData("C1:C4");
$series = $chart->getNSeries()->get(1);
//Setting the values of the series
$series->setValues("=B1:B4");
//Changing the chart type of the series
$series->setType(cells\ChartType::LINE);
//Setting marker properties
$series->getMarker()->setMarkerStyle(cells\ChartMarkerType::CIRCLE);
$series->getMarker()->setForegroundColorSetType(cells\FormattingType::AUTOMATIC);
$series->getMarker()->setForegroundColor(cells\Color::getBlack());
$series->getMarker()->setBackgroundColorSetType(cells\FormattingType::AUTOMATIC);

Property Getters/Setters Summary
functiongetArea()
Represents the background area of Series object.
functiongetBar3DShapeType()
function
           Gets or sets the 3D shape type used with the 3-D bar or column chart. The value of the property is Bar3DShapeType integer constant.
functiongetBorder()
Represents border of Series object.
functiongetBubbleScale()
function
           Gets or sets the scale factor for bubbles in the specified chart group. It can be an integer value from 0 (zero) to 300, corresponding to a percentage of the default size. Applies only to bubble charts.
functiongetBubbleSizeRepresents()
function
           Gets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant.
functiongetBubbleSizes()
function
           Gets or sets the bubble sizes values of the chart series.
functiongetCountOfDataValues()
Gets the number of the data values.
functiongetDataLabels()
Represents the DataLabels object for the specified ASeries.
functiongetDisplayName()
Gets the series's name that displays on the chart graph.
functiongetDoughnutHoleSize()
function
           Returns or sets the size of the hole in a doughnut chart group. The hole size is expressed as a percentage of the chart size, between 10 and 90 percent.
functiongetDownBars()
Returns a DropBars object that represents the down bars on a line chart. Applies only to line charts.
functiongetDropLines()
Returns a Line object that represents the drop lines for a series on the line chart or area chart. Applies only to line chart or area charts.
functiongetExplosion()
function
           The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
functiongetFirstSliceAngle()
function
           Gets or sets the angle of the first pie-chart or doughnut-chart slice, in degrees (clockwise from vertical). Applies only to pie, 3-D pie, and doughnut charts, 0 to 360.
functiongetGapWidth()
function
           Returns or sets the space between bar or column clusters, as a percentage of the bar or column width. The value of this property must be between 0 and 500.
functiongetHas3DEffect()
function
           True if the series has a three-dimensional appearance. Applies only to bubble charts.
functionhasDropLines()
function
           True if the chart has drop lines. Applies only to line chart or area charts.
functionhasHiLoLines()
function
           True if the line chart has high-low lines. Applies only to line charts.
functionhasLeaderLines()
function
           True if the series has leader lines.
functionhasRadarAxisLabels()
function
           True if a radar chart has category axis labels. Applies only to radar charts.
functionhasSeriesLines()
function
           True if a stacked column chart or bar chart has series lines or if a Pie of Pie chart or Bar of Pie chart has connector lines between the two sections. Applies only to stacked column charts, bar charts, Pie of Pie charts, or Bar of Pie charts.
functionhasUpDownBars()
function
           True if a line chart has up and down bars. Applies only to line charts.
functiongetHiLoLines()
Returns a HiLoLines object that represents the high-low lines for a series on a line chart. Applies only to line charts.
functionisAutoSplit()
Indicates whether the threshold value is automatic.
functionisColorVaried()
function
           Represents if the color of points is varied. The chart must contain only one series.
functionisFiltered()
function
           Indicates whether the series is selected or filtered.True represents this series is filtered, and it will not be displayed on the chart.
functionisVerticalValues()
Indicates whether the data source is vertical.
functiongetLayoutProperties()
Represents the properties of layout.
functiongetLeaderLines()
Represents leader lines on a chart. Leader lines connect data labels to data points. This object isn’t a collection; there’s no object that represents a single leader line.
functiongetLegendEntry()
Gets the legend entry according to this series.
functiongetMarker()
Gets the Marker.
functiongetName()
function
setName(value)
           Gets or sets the name of the data series.
functiongetOverlap()
function
setOverlap(value)
           Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts.
functiongetPlotOnSecondAxis()
function
           Indicates if this series is plotted on second value axis.
functiongetPoints()
Gets the collection of points in a series in a chart.
functiongetSecondPlotSize()
function
           Returns or sets the size of the secondary section of either a pie of pie chart or a bar of pie chart, as a percentage of the size of the primary pie. Can be a value from 5 to 200.
functiongetSeriesLines()
Returns a SeriesLines object that represents the series lines for a stacked bar chart or a stacked column chart. Applies only to stacked bar and stacked column charts.
functiongetShadow()
function
setShadow(value)
           True if the series has a shadow.
functiongetShapeProperties()
Gets the ShapePropertyCollection object that holds the visual shape properties of the Series.
functiongetShowNegativeBubbles()
function
           True if negative bubbles are shown for the chart group. Valid only for bubble charts.
functiongetSizeRepresents()
function
           Gets or sets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant.
functiongetSmooth()
function
setSmooth(value)
           Represents curve smoothing. True if curve smoothing is turned on for the line chart or scatter chart. Applies only to line and scatter connected by lines charts.
functiongetSplitType()
function
           Returns or sets a value that how to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart. The value of the property is ChartSplitType integer constant.
functiongetSplitValue()
function
           Returns or sets a value that shall be used to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart.
functiongetTrendLines()
Returns an object that represents a collection of all the trendlines for the series.
functiongetType()
function
setType(value)
           Gets or sets a data series' type. The value of the property is ChartType integer constant.
functiongetUpBars()
Returns an DropBars object that represents the up bars on a line chart. Applies only to line charts.
functiongetValues()
function
setValues(value)
           Represents the data of the chart series.
functiongetValuesFormatCode()
function
           Represents format code of Values‘s NumberList.
functiongetXErrorBar()
Represents X direction error bar of the series.
functiongetXValues()
function
setXValues(value)
           Represents the x values of the chart series.
functiongetYErrorBar()
Represents Y direction error bar of the series.
 
Method Summary
functionmove(count)
Moves the series up or down.
 

    • Property Getters/Setters Detail

      • isFiltered/setFiltered : boolean 

        function isFiltered() / function setFiltered(value)
        
        Indicates whether the series is selected or filtered.True represents this series is filtered, and it will not be displayed on the chart.
      • getLayoutProperties : SeriesLayoutProperties 

        function getLayoutProperties()
        
        Represents the properties of layout.
      • getPoints : ChartPointCollection 

        function getPoints()
        
        Gets the collection of points in a series in a chart. When the chart is Pie of Pie or Bar of Pie, the last point is other point in first pie plot.
      • getArea : Area 

        function getArea()
        
        Represents the background area of Series object.
      • getBorder : Line 

        function getBorder()
        
        Represents border of Series object.
      • getName/setName : String 

        function getName() / function setName(value)
        
        Gets or sets the name of the data series.

        Example:

        //Reference name to a cell
        $workbook = new cells\Workbook();
        //Get the first worksheet
        $worksheet = $workbook->getWorksheets()->get(0);
        $cells = $worksheet->getCells();
        //Put values in cells
        $cells->get("A1")->putValue(1);
        $cells->get("A2")->putValue(2);
        $cells->get("A3")->putValue(3);
        //Adding a chart to the worksheet
        $chartIndex = $worksheet->getCharts()->add(cells\ChartType::COLUMN, 5, 0, 15, 5);
        //Accessing the instance of the newly added chart
        $chart = $worksheet->getCharts()->get($chartIndex);
        //Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B4"
        $chart->getNSeries()->add("A1:B4", true);
        //Reference name to a cell
        $chart->getNSeries()->get(0)->setName("=A1");
        //Set a string to name
        $chart->getNSeries()->get(0)->setName("First Series");
      • getDisplayName : String 

        function getDisplayName()
        
        Gets the series's name that displays on the chart graph.
      • getCountOfDataValues : Number 

        function getCountOfDataValues()
        
        Gets the number of the data values.
      • isVerticalValues : boolean 

        function isVerticalValues()
        
        Indicates whether the data source is vertical.
      • getValues/setValues : String 

        function getValues() / function setValues(value)
        
        Represents the data of the chart series.
      • getValuesFormatCode/setValuesFormatCode : String 

        function getValuesFormatCode() / function setValuesFormatCode(value)
        
        Represents format code of Values‘s NumberList.
      • getXValues/setXValues : String 

        function getXValues() / function setXValues(value)
        
        Represents the x values of the chart series.
      • getBubbleSizes/setBubbleSizes : String 

        function getBubbleSizes() / function setBubbleSizes(value)
        
        Gets or sets the bubble sizes values of the chart series.
      • getTrendLines : TrendlineCollection 

        function getTrendLines()
        
        Returns an object that represents a collection of all the trendlines for the series.
      • getSmooth/setSmooth : boolean 

        function getSmooth() / function setSmooth(value)
        
        Represents curve smoothing. True if curve smoothing is turned on for the line chart or scatter chart. Applies only to line and scatter connected by lines charts.
      • getShadow/setShadow : boolean 

        function getShadow() / function setShadow(value)
        
        True if the series has a shadow.
      • getHas3DEffect/setHas3DEffect : boolean 

        function getHas3DEffect() / function setHas3DEffect(value)
        
        True if the series has a three-dimensional appearance. Applies only to bubble charts.
      • getBar3DShapeType/setBar3DShapeType : Number 

        function getBar3DShapeType() / function setBar3DShapeType(value)
        
        Gets or sets the 3D shape type used with the 3-D bar or column chart. The value of the property is Bar3DShapeType integer constant.
      • getDataLabels : DataLabels 

        function getDataLabels()
        
        Represents the DataLabels object for the specified ASeries.
      • getType/setType : Number 

        function getType() / function setType(value)
        
        Gets or sets a data series' type. The value of the property is ChartType integer constant.
      • getMarker : Marker 

        function getMarker()
        
        Gets the Marker.
      • getPlotOnSecondAxis/setPlotOnSecondAxis : boolean 

        function getPlotOnSecondAxis() / function setPlotOnSecondAxis(value)
        
        Indicates if this series is plotted on second value axis.
      • getXErrorBar : ErrorBar 

        function getXErrorBar()
        
        Represents X direction error bar of the series.
      • getYErrorBar : ErrorBar 

        function getYErrorBar()
        
        Represents Y direction error bar of the series.
      • hasHiLoLines/setHasHiLoLines : boolean 

        function hasHiLoLines() / function setHasHiLoLines(value)
        
        True if the line chart has high-low lines. Applies only to line charts.
      • getHiLoLines : Line 

        function getHiLoLines()
        
        Returns a HiLoLines object that represents the high-low lines for a series on a line chart. Applies only to line charts.
      • hasSeriesLines/setHasSeriesLines : boolean 

        function hasSeriesLines() / function setHasSeriesLines(value)
        
        True if a stacked column chart or bar chart has series lines or if a Pie of Pie chart or Bar of Pie chart has connector lines between the two sections. Applies only to stacked column charts, bar charts, Pie of Pie charts, or Bar of Pie charts.
      • getSeriesLines : Line 

        function getSeriesLines()
        
        Returns a SeriesLines object that represents the series lines for a stacked bar chart or a stacked column chart. Applies only to stacked bar and stacked column charts.
      • hasDropLines/setHasDropLines : boolean 

        function hasDropLines() / function setHasDropLines(value)
        
        True if the chart has drop lines. Applies only to line chart or area charts.
      • getDropLines : Line 

        function getDropLines()
        
        Returns a Line object that represents the drop lines for a series on the line chart or area chart. Applies only to line chart or area charts.
      • hasUpDownBars/setHasUpDownBars : boolean 

        function hasUpDownBars() / function setHasUpDownBars(value)
        
        True if a line chart has up and down bars. Applies only to line charts.
      • getUpBars : DropBars 

        function getUpBars()
        
        Returns an DropBars object that represents the up bars on a line chart. Applies only to line charts.
      • getDownBars : DropBars 

        function getDownBars()
        
        Returns a DropBars object that represents the down bars on a line chart. Applies only to line charts.
      • isColorVaried/setColorVaried : boolean 

        function isColorVaried() / function setColorVaried(value)
        
        Represents if the color of points is varied. The chart must contain only one series.
      • getGapWidth/setGapWidth : Number 

        function getGapWidth() / function setGapWidth(value)
        
        Returns or sets the space between bar or column clusters, as a percentage of the bar or column width. The value of this property must be between 0 and 500.
      • getFirstSliceAngle/setFirstSliceAngle : Number 

        function getFirstSliceAngle() / function setFirstSliceAngle(value)
        
        Gets or sets the angle of the first pie-chart or doughnut-chart slice, in degrees (clockwise from vertical). Applies only to pie, 3-D pie, and doughnut charts, 0 to 360.
      • getOverlap/setOverlap : Number 

        function getOverlap() / function setOverlap(value)
        
        Specifies how bars and columns are positioned. Can be a value between – 100 and 100. Applies only to 2-D bar and 2-D column charts.
      • getSecondPlotSize/setSecondPlotSize : Number 

        function getSecondPlotSize() / function setSecondPlotSize(value)
        
        Returns or sets the size of the secondary section of either a pie of pie chart or a bar of pie chart, as a percentage of the size of the primary pie. Can be a value from 5 to 200.
      • getSplitType/setSplitType : Number 

        function getSplitType() / function setSplitType(value)
        
        Returns or sets a value that how to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart. The value of the property is ChartSplitType integer constant.
      • getSplitValue/setSplitValue : Number 

        function getSplitValue() / function setSplitValue(value)
        
        Returns or sets a value that shall be used to determine which data points are in the second pie or bar on a pie of pie or bar of pie chart.
      • isAutoSplit : boolean 

        function isAutoSplit()
        
        Indicates whether the threshold value is automatic.
      • getBubbleScale/setBubbleScale : Number 

        function getBubbleScale() / function setBubbleScale(value)
        
        Gets or sets the scale factor for bubbles in the specified chart group. It can be an integer value from 0 (zero) to 300, corresponding to a percentage of the default size. Applies only to bubble charts.
      • getSizeRepresents/setSizeRepresents : Number 

        function getSizeRepresents() / function setSizeRepresents(value)
        
        Gets or sets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant. BubbleSizeRepresents.SizeIsArea means the value BubbleSizes is the area of the bubble. BubbleSizeRepresents.SizeIsWidth means the value BubbleSizes is the width of the bubble.
      • getShowNegativeBubbles/setShowNegativeBubbles : boolean 

        function getShowNegativeBubbles() / function setShowNegativeBubbles(value)
        
        True if negative bubbles are shown for the chart group. Valid only for bubble charts.
      • getDoughnutHoleSize/setDoughnutHoleSize : Number 

        function getDoughnutHoleSize() / function setDoughnutHoleSize(value)
        
        Returns or sets the size of the hole in a doughnut chart group. The hole size is expressed as a percentage of the chart size, between 10 and 90 percent.
      • getExplosion/setExplosion : Number 

        function getExplosion() / function setExplosion(value)
        
        The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
      • hasRadarAxisLabels/setHasRadarAxisLabels : boolean 

        function hasRadarAxisLabels() / function setHasRadarAxisLabels(value)
        
        True if a radar chart has category axis labels. Applies only to radar charts.
      • hasLeaderLines/setHasLeaderLines : boolean 

        function hasLeaderLines() / function setHasLeaderLines(value)
        
        True if the series has leader lines.
      • getLeaderLines : Line 

        function getLeaderLines()
        
        Represents leader lines on a chart. Leader lines connect data labels to data points. This object isn’t a collection; there’s no object that represents a single leader line.
      • getLegendEntry : LegendEntry 

        function getLegendEntry()
        
        Gets the legend entry according to this series.
      • getBubbleSizeRepresents/setBubbleSizeRepresents : Number 

        function getBubbleSizeRepresents() / function setBubbleSizeRepresents(value)
        
        Gets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant. the bubble size represents on a bubble chart. NOTE: This member is now obsolete. Instead, please use Aspose.Cells.Charts.Series.SizeRepresents property. This property will be removed 12 months later since JANUARY 2012. Aspose apologizes for any inconvenience you may have experienced.
    • Method Detail

      • move

        function move(count)
        Moves the series up or down.
        Parameters:
        count: Number - The number of moving up or down. Move the series up if this is less than zero; Move the series down if this is greater than zero.