com.aspose.cells

Class Series

  • java.lang.Object
    • com.aspose.cells.Series
public class Series 
extends java.lang.Object

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

Example:

//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Excel object
int sheetIndex = workbook.getWorksheets().add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet 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
int chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 15, 5);
//Accessing the instance of the newly added chart
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 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.setMarkerStyle(ChartMarkerType.CIRCLE);
series.setMarkerForegroundColorSetType(FormattingType.AUTOMATIC);
series.setMarkerForegroundColor(com.aspose.cells.Color.getBlack());
series.setMarkerBackgroundColorSetType(FormattingType.AUTOMATIC);
//Saving the Excel file
workbook.save("C:\\book1.xls");

Property Getters/Setters Summary
AreagetArea()
Represents the background area of Series object.
intgetBar3DShapeType()
void
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.
intgetBarShape()
void
setBarShape(intvalue)
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.
LinegetBorder()
Represents border of Series object.
intgetBubbleScale()
void
setBubbleScale(intvalue)
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.
intgetBubbleSizeRepresents()
void
Gets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant.
java.lang.StringgetBubbleSizes()
void
setBubbleSizes(java.lang.Stringvalue)
Gets or sets the bubble sizes values of the chart series.
intgetCountOfDataValues()
Gets the number of the data values.
DataLabelsgetDataLabels()
Represents the DataLabels object for the specified ASeries.
java.lang.StringgetDisplayName()
Gets the series's name that displays on the chart graph.
intgetDoughnutHoleSize()
void
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.
DropBarsgetDownBars()
Returns a DropBars object that represents the down bars on a line chart. Applies only to line charts.
LinegetDropLines()
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.
intgetExplosion()
void
setExplosion(intvalue)
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
shortgetFirstSliceAngle()
void
setFirstSliceAngle(shortvalue)
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.
shortgetGapWidth()
void
setGapWidth(shortvalue)
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.
booleangetHas3DEffect()
void
setHas3DEffect(booleanvalue)
True if the series has a three-dimensional appearance. Applies only to bubble charts.
booleanhasDropLines()
void
setHasDropLines(booleanvalue)
True if the chart has drop lines. Applies only to line chart or area charts.
booleanhasHiLoLines()
void
setHasHiLoLines(booleanvalue)
True if the line chart has high-low lines. Applies only to line charts.
booleanhasLeaderLines()
void
setHasLeaderLines(booleanvalue)
True if the series has leader lines.
booleanhasRadarAxisLabels()
void
setHasRadarAxisLabels(booleanvalue)
True if a radar chart has category axis labels. Applies only to radar charts.
booleanhasSeriesLines()
void
setHasSeriesLines(booleanvalue)
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.
booleanhasUpDownBars()
void
setHasUpDownBars(booleanvalue)
True if a line chart has up and down bars. Applies only to line charts.
LinegetHiLoLines()
Returns a HiLoLines object that represents the high-low lines for a series on a line chart. Applies only to line charts.
booleanisAutoSplit()
Indicates whether the threshold value is automatic.
booleanisColorVaried()
void
setColorVaried(booleanvalue)
Represents if the color of points is varied. The chart must contain only one series.
booleanisVerticalValues()
Indicates whether the data source is vertical.
LinegetLeaderLines()
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.
LegendEntrygetLegendEntry()
Gets the legend entry according to this series.
LinegetLine()
Represents border of Series object.
MarkergetMarker()
Gets the Marker.
ColorgetMarkerBackgroundColor()
void
Represents the marker background color in a line chart, scatter chart, or radar chart.
intgetMarkerBackgroundColorSetType()
void
Gets or sets the marker background color set type. The value of the property is FormattingType integer constant.
ColorgetMarkerForegroundColor()
void
Represents the marker foreground color in a line chart, scatter chart, or radar chart.
intgetMarkerForegroundColorSetType()
void
Gets or sets the marker foreground color set type. The value of the property is FormattingType integer constant.
intgetMarkerSize()
void
setMarkerSize(intvalue)
Represents the marker size in a line chart, scatter chart, or radar chart.
intgetMarkerStyle()
void
setMarkerStyle(intvalue)
Represents the marker style in a line chart, scatter chart, or radar chart. The value of the property is ChartMarkerType integer constant.
java.lang.StringgetName()
void
setName(java.lang.Stringvalue)
Gets or sets the name of the data series.
shortgetOverlap()
void
setOverlap(shortvalue)
Specifies how bars and columns are positioned. Can be a value between ¨C 100 and 100. Applies only to 2-D bar and 2-D column charts.
booleangetPlotOnSecondAxis()
void
setPlotOnSecondAxis(booleanvalue)
Indicates if this series is plotted on second value axis.
ChartPointCollectiongetPoints()
Gets the collection of points in a series in a chart.
shortgetSecondPlotSize()
void
setSecondPlotSize(shortvalue)
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.
LinegetSeriesLines()
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.
booleangetShadow()
void
setShadow(booleanvalue)
True if the series has a shadow.
ShapePropertyCollectiongetShapeProperties()
Gets the object that holds the visual shape properties of the Series.
booleangetShowNegativeBubbles()
void
True if negative bubbles are shown for the chart group. Valid only for bubble charts.
intgetSizeRepresents()
void
Gets or sets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant.
booleangetSmooth()
void
setSmooth(booleanvalue)
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.
intgetSplitType()
void
setSplitType(intvalue)
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.
doublegetSplitValue()
void
setSplitValue(doublevalue)
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.
TrendlineCollectiongetTrendLines()
Returns an object that represents a collection of all the trendlines for the series.
intgetType()
void
setType(intvalue)
Gets or sets a data series' type. The value of the property is ChartType integer constant.
DropBarsgetUpBars()
Returns an DropBars object that represents the up bars on a line chart. Applies only to line charts.
java.lang.StringgetValues()
void
setValues(java.lang.Stringvalue)
Represents the data of the chart series.
java.lang.StringgetValuesFormatCode()
void
setValuesFormatCode(java.lang.Stringvalue)
Represents format code of Values¡®s NumberList.
ErrorBargetXErrorBar()
Represents X direction error bar of the series.
java.lang.StringgetXValues()
void
setXValues(java.lang.Stringvalue)
Represents the x values of the chart series.
ErrorBargetYErrorBar()
Represents Y direction error bar of the series.
 
Method Summary
voidmove(intcount)
Moves the series up or down.
 

    • Property Getters/Setters Detail

      • getPoints

        public 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

        public Area getArea()
        
        Represents the background area of Series object.
      • getLine

        public Line getLine()
        
        Represents border of Series object. NOTE: This member is now obsolete. Instead, please use Border property. This property will be removed 12 months later since Mar. 2012. Aspose apologizes for any inconvenience you may have experienced.
      • getBorder

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

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

        Example:

        //Reference name to a cell
        chart.getNSeries().get(0).setName("=A1");
        
        //Set a string to name
        chart.getNSeries().get(0).setName("First Series");
      • getDisplayName

        public java.lang.String getDisplayName()
        
        Gets the series's name that displays on the chart graph.
      • getCountOfDataValues

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

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

        public java.lang.String getValues() / public void setValues(java.lang.String value)
        
        Represents the data of the chart series.
      • getValuesFormatCode/setValuesFormatCode

        public java.lang.String getValuesFormatCode() / public void setValuesFormatCode(java.lang.String value)
        
        Represents format code of Values¡®s NumberList.
      • getXValues/setXValues

        public java.lang.String getXValues() / public void setXValues(java.lang.String value)
        
        Represents the x values of the chart series.
      • getBubbleSizes/setBubbleSizes

        public java.lang.String getBubbleSizes() / public void setBubbleSizes(java.lang.String value)
        
        Gets or sets the bubble sizes values of the chart series.
      • getTrendLines

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

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

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

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

        public int getBar3DShapeType() / public void setBar3DShapeType(int 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.
      • getBarShape/setBarShape

        public int getBarShape() / public void setBarShape(int 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.NOTE: This member is now obsolete. Instead, please use ASeries.Bar3DShapeType property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.
      • getDataLabels

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

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

        public Marker getMarker()
        
        Gets the Marker.
      • getMarkerStyle/setMarkerStyle

        public int getMarkerStyle() / public void setMarkerStyle(int value)
        
        Represents the marker style in a line chart, scatter chart, or radar chart. The value of the property is ChartMarkerType integer constant.NOTE: This member is now obsolete. Instead, please use Marker.MarkerStyle property. This property will be removed 12 months later since August 2012. Aspose apologizes for any inconvenience you may have experienced.
      • getMarkerSize/setMarkerSize

        public int getMarkerSize() / public void setMarkerSize(int value)
        
        Represents the marker size in a line chart, scatter chart, or radar chart. NOTE: This member is now obsolete. Instead, please use Marker.MarkerSize property. This property will be removed 12 months later since August 2012. Aspose apologizes for any inconvenience you may have experienced.
      • getMarkerForegroundColor/setMarkerForegroundColor

        public Color getMarkerForegroundColor() / public void setMarkerForegroundColor(Color value)
        
        Represents the marker foreground color in a line chart, scatter chart, or radar chart. NOTE: This member is now obsolete. Instead, please use Marker.MarkerForegroundColor property. This property will be removed 12 months later since August 2012. Aspose apologizes for any inconvenience you may have experienced.
      • getMarkerForegroundColorSetType/setMarkerForegroundColorSetType

        public int getMarkerForegroundColorSetType() / public void setMarkerForegroundColorSetType(int value)
        
        Gets or sets the marker foreground color set type. The value of the property is FormattingType integer constant.NOTE: This member is now obsolete. Instead, please use Marker.MarkerForegroundColorSetType property. This property will be removed 12 months later since August 2012. Aspose apologizes for any inconvenience you may have experienced. FormattingType.Automatic is same as ChartLineFormattingType.Automatic. FormattingType.None is same as ChartLineFormattingType.None. FormattingType.InnerCustom is same as ChartLineFormattingType.Solid.
      • getMarkerBackgroundColor/setMarkerBackgroundColor

        public Color getMarkerBackgroundColor() / public void setMarkerBackgroundColor(Color value)
        
        Represents the marker background color in a line chart, scatter chart, or radar chart. NOTE: This member is now obsolete. Instead, please use Marker.MarkerBackgroundColor property. This property will be removed 12 months later since August 2012. Aspose apologizes for any inconvenience you may have experienced.
      • getMarkerBackgroundColorSetType/setMarkerBackgroundColorSetType

        public int getMarkerBackgroundColorSetType() / public void setMarkerBackgroundColorSetType(int value)
        
        Gets or sets the marker background color set type. The value of the property is FormattingType integer constant.NOTE: This member is now obsolete. Instead, please use Marker.MarkerBackgroundColorSetType property. This property will be removed 12 months later since August 2012. Aspose apologizes for any inconvenience you may have experienced. FormattingType.Automatic is same as ChartLineFormattingType.Automatic. FormattingType.None is same as ChartLineFormattingType.None. FormattingType.InnerCustom is same as ChartLineFormattingType.Solid.
      • getPlotOnSecondAxis/setPlotOnSecondAxis

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

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

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

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

        public 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

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

        public 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

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

        public 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

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

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

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

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

        public short getGapWidth() / public void setGapWidth(short 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

        public short getFirstSliceAngle() / public void setFirstSliceAngle(short 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

        public short getOverlap() / public void setOverlap(short value)
        
        Specifies how bars and columns are positioned. Can be a value between ¨C 100 and 100. Applies only to 2-D bar and 2-D column charts.
      • getSecondPlotSize/setSecondPlotSize

        public short getSecondPlotSize() / public void setSecondPlotSize(short 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

        public int getSplitType() / public void setSplitType(int 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

        public double getSplitValue() / public void setSplitValue(double 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

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

        public int getBubbleScale() / public void setBubbleScale(int 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

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

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

        public int getDoughnutHoleSize() / public void setDoughnutHoleSize(int 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

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

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

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

        public 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.
      • getLegendEntry

        public LegendEntry getLegendEntry()
        
        Gets the legend entry according to this series.
      • getBubbleSizeRepresents/setBubbleSizeRepresents

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

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