asposecells.api

Class Series

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

Example:

# Instantiating a Workbook object
workbook = 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(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(ChartType.LINE)
# Setting marker properties.
series.getMarker().setMarkerStyle(ChartMarkerType.CIRCLE)
series.getMarker().setForegroundColorSetType(FormattingType.AUTOMATIC)
series.getMarker().setForegroundColor(Color.getBlack())
series.getMarker().setBackgroundColorSetType(FormattingType.AUTOMATIC)
# Saving the Excel file
workbook.save("Book1.xls")

Property Getters/Setters Summary
methodgetArea()
Represents the background area of Series object.
methodgetBar3DShapeType()
method
           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.
methodgetBorder()
Represents border of Series object.
methodgetBubbleScale()
method
           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.
methodgetBubbleSizeRepresents()
method
           Gets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant.
methodgetBubbleSizes()
method
           Gets or sets the bubble sizes values of the chart series.
methodgetCountOfDataValues()
Gets the number of the data values.
methodgetDataLabels()
Represents the DataLabels object for the specified ASeries.
methodgetDisplayName()
Gets the series's name that displays on the chart graph.
methodgetDoughnutHoleSize()
method
           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.
methodgetDownBars()
Returns a DropBars object that represents the down bars on a line chart. Applies only to line charts.
methodgetDropLines()
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.
methodgetExplosion()
method
           The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
methodgetFirstSliceAngle()
method
           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.
methodgetGapWidth()
method
           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.
methodgetHas3DEffect()
method
           True if the series has a three-dimensional appearance. Applies only to bubble charts.
methodhasDropLines()
method
           True if the chart has drop lines. Applies only to line chart or area charts.
methodhasHiLoLines()
method
           True if the line chart has high-low lines. Applies only to line charts.
methodhasLeaderLines()
method
           True if the series has leader lines.
methodhasRadarAxisLabels()
method
           True if a radar chart has category axis labels. Applies only to radar charts.
methodhasSeriesLines()
method
           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.
methodhasUpDownBars()
method
           True if a line chart has up and down bars. Applies only to line charts.
methodgetHiLoLines()
Returns a HiLoLines object that represents the high-low lines for a series on a line chart. Applies only to line charts.
methodisAutoSplit()
Indicates whether the threshold value is automatic.
methodisColorVaried()
method
           Represents if the color of points is varied. The chart must contain only one series.
methodisFiltered()
method
           Indicates whether the series is selected or filtered.True represents this series is filtered, and it will not be displayed on the chart.
methodisVerticalValues()
Indicates whether the data source is vertical.
methodgetLayoutProperties()
Represents the properties of layout.
methodgetLeaderLines()
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.
methodgetLegendEntry()
Gets the legend entry according to this series.
methodgetMarker()
Gets the Marker.
methodgetName()
method
setName(value)
           Gets or sets the name of the data series.
methodgetOverlap()
method
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.
methodgetPlotOnSecondAxis()
method
           Indicates if this series is plotted on second value axis.
methodgetPoints()
Gets the collection of points in a series in a chart.
methodgetSecondPlotSize()
method
           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.
methodgetSeriesLines()
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.
methodgetShadow()
method
setShadow(value)
           True if the series has a shadow.
methodgetShapeProperties()
Gets the ShapePropertyCollection object that holds the visual shape properties of the Series.
methodgetShowNegativeBubbles()
method
           True if negative bubbles are shown for the chart group. Valid only for bubble charts.
methodgetSizeRepresents()
method
           Gets or sets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant.
methodgetSmooth()
method
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.
methodgetSplitType()
method
           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.
methodgetSplitValue()
method
           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.
methodgetTrendLines()
Returns an object that represents a collection of all the trendlines for the series.
methodgetType()
method
setType(value)
           Gets or sets a data series' type. The value of the property is ChartType integer constant.
methodgetUpBars()
Returns an DropBars object that represents the up bars on a line chart. Applies only to line charts.
methodgetValues()
method
setValues(value)
           Represents the data of the chart series.
methodgetValuesFormatCode()
method
           Represents format code of Values‘s NumberList.
methodgetXErrorBar()
Represents X direction error bar of the series.
methodgetXValues()
method
setXValues(value)
           Represents the x values of the chart series.
methodgetYErrorBar()
Represents Y direction error bar of the series.
 
Method Summary
methodmove(count)
Moves the series up or down.
 

    • Property Getters/Setters Detail

      • isFiltered/setFiltered : boolean 

        boolean isFiltered() / 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.
      • getPoints : ChartPointCollection 

        ChartPointCollection 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 

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

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

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

        Example:

        workbook = Workbook()
        # Get the first worksheet.
        worksheet = workbook.getWorksheets().get(0)
        # Adding a chart to the worksheet
        chartIndex = worksheet.getCharts().add(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 

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

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

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

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

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

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

        String getBubbleSizes() / setBubbleSizes(value)
        
        Gets or sets the bubble sizes values of the chart series.
      • getSmooth/setSmooth : boolean 

        boolean getSmooth() / 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 

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

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

        int getBar3DShapeType() / 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 

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

        int getType() / setType(value)
        
        Gets or sets a data series' type. The value of the property is ChartType integer constant.
      • getPlotOnSecondAxis/setPlotOnSecondAxis : boolean 

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

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

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

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

        Line 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 

        boolean hasSeriesLines() / 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 

        Line 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 

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

        Line 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 

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

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

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

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

        int getGapWidth() / 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 : int 

        int getFirstSliceAngle() / 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 : int 

        int getOverlap() / 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 : int 

        int getSecondPlotSize() / 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 : int 

        int getSplitType() / 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 : float 

        float getSplitValue() / 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 

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

        int getBubbleScale() / 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 : int 

        int getSizeRepresents() / 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 

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

        int getDoughnutHoleSize() / 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 : int 

        int getExplosion() / 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 

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

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

        Line 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.
      • getBubbleSizeRepresents/setBubbleSizeRepresents : int 

        int getBubbleSizeRepresents() / 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

         move(count)
        Moves the series up or down.
        Parameters:
        count: int - 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.