public class Series
extends java.lang.Object
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"
int seriesIndex = 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(seriesIndex);
//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(com.aspose.cells.Color.getBlack());
series.getMarker().setBackgroundColorSetType(FormattingType.AUTOMATIC);
//do your business
//Saving the Excel file
workbook.save("book1.xls");
| Modifier and Type | Method and Description |
|---|---|
Area |
getArea()
Represents the background area of Series object.
|
int |
getBar3DShapeType()
Gets the 3D shape type used with the 3-D bar or column chart.
|
Line |
getBorder()
Represents border of Series object.
|
int |
getBubbleScale()
Gets the scale factor for bubbles in the specified chart group.
|
int |
getBubbleSizeRepresents()
Deprecated.
Use Aspose.Cells.Charts.Series.SizeRepresents property instead.
|
java.lang.String |
getBubbleSizes()
Gets the bubble sizes values of the chart series.
|
java.util.ArrayList |
getCachedCategoryValues()
Deprecated.
internal use only
|
java.util.ArrayList |
getCachedValues()
Deprecated.
internal use only
|
int |
getCountOfDataValues()
Gets the number of the data values.
|
DataLabels |
getDataLabels()
Represents the DataLabels object for the specified ASeries.
|
java.lang.String |
getDisplayName()
Gets the series's name that displays on the chart graph.
|
int |
getDoughnutHoleSize()
Returns or sets the size of the hole in a doughnut chart group.
|
DropBars |
getDownBars()
Returns a
DropBars object that represents the down bars on a line chart. |
Line |
getDropLines()
Returns a
Line object that represents the drop lines for a series on the line chart or area chart. |
int |
getExplosion()
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
|
short |
getFirstSliceAngle()
Gets the angle of the first pie-chart or doughnut-chart slice, in degrees (clockwise from vertical).
|
short |
getGapWidth()
Returns or sets the space between bar or column clusters, as a percentage of the bar or column width.
|
boolean |
getHas3DEffect()
True if the series has a three-dimensional appearance.
|
Line |
getHiLoLines()
Returns a HiLoLines object that represents the high-low lines for a series on a line chart.
|
SeriesLayoutProperties |
getLayoutProperties()
Represents the properties of layout.
|
Line |
getLeaderLines()
Represents leader lines on a chart.
|
LegendEntry |
getLegendEntry()
Gets the legend entry according to this series.
|
Marker |
getMarker()
Gets the
getMarker(). |
java.lang.String |
getName()
Gets the name of the data series.
|
short |
getOverlap()
Specifies how bars and columns are positioned.
|
boolean |
getPlotOnSecondAxis()
Indicates if this series is plotted on second value axis.
|
ChartPointCollection |
getPoints()
Gets the collection of points in a series in a chart.
|
short |
getSecondPlotSize()
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.
|
Line |
getSeriesLines()
Returns a SeriesLines object that represents the series lines for a stacked bar chart or a stacked column chart.
|
boolean |
getShadow()
True if the series has a shadow.
|
ShapePropertyCollection |
getShapeProperties()
Gets the
ShapePropertyCollection object that holds the visual shape properties of the Series. |
boolean |
getShowNegativeBubbles()
True if negative bubbles are shown for the chart group.
|
int |
getSizeRepresents()
Gets what the bubble size represents on a bubble chart.
|
boolean |
getSmooth()
Represents curve smoothing.
|
int |
getSplitType()
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.
|
double |
getSplitValue()
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.
|
TrendlineCollection |
getTrendLines()
Returns all the trendlines of this series.
|
int |
getType()
Gets a data series' type.
|
DropBars |
getUpBars()
Returns an DropBars object that represents the up bars on a line chart.
|
java.lang.String |
getValues()
Represents the Y values of this chart series.
|
java.lang.String |
getValuesFormatCode()
Represents format code of Values's NumberList.
|
ErrorBar |
getXErrorBar()
Represents X direction error bar of the series.
|
java.lang.String |
getXValues()
Represents the x values of the chart series.
|
java.lang.String |
getXValuesFormatCode()
Represents format code of X Values's NumberList.
|
ErrorBar |
getYErrorBar()
Represents Y direction error bar of the series.
|
boolean |
hasDropLines()
True if the chart has drop lines.
|
boolean |
hasHiLoLines()
True if the line chart has high-low lines.
|
boolean |
hasLeaderLines()
True if the series has leader lines.
|
boolean |
hasRadarAxisLabels()
True if a radar chart has category axis labels.
|
boolean |
hasSeriesLines()
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.
|
boolean |
hasUpDownBars()
True if a line chart has up and down bars.
|
boolean |
isAutoSplit()
Indicates whether the threshold value is automatic.
|
boolean |
isColorVaried()
Represents if the color of points is varied.
|
boolean |
isFiltered()
Indicates whether the series is selected or filtered.True represents this series is filtered, and it will not be displayed on the chart.
|
boolean |
isVerticalValues()
Indicates whether the data source is vertical.
|
void |
move(int count)
Moves the series up or down.
|
void |
setBar3DShapeType(int value)
Sets the 3D shape type used with the 3-D bar or column chart.
|
void |
setBubbleScale(int value)
Sets the scale factor for bubbles in the specified chart group.
|
void |
setBubbleSizeRepresents(int value)
Deprecated.
Use Aspose.Cells.Charts.Series.SizeRepresents property instead.
|
void |
setBubbleSizes(java.lang.String value)
Sets the bubble sizes values of the chart series.
|
void |
setColorVaried(boolean value)
Represents if the color of points is varied.
|
void |
setDoughnutHoleSize(int value)
Returns or sets the size of the hole in a doughnut chart group.
|
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.
|
void |
setFiltered(boolean value)
Indicates whether the series is selected or filtered.True represents this series is filtered, and it will not be displayed on the chart.
|
void |
setFirstSliceAngle(short value)
Sets the angle of the first pie-chart or doughnut-chart slice, in degrees (clockwise from vertical).
|
void |
setGapWidth(short value)
Returns or sets the space between bar or column clusters, as a percentage of the bar or column width.
|
void |
setHas3DEffect(boolean value)
True if the series has a three-dimensional appearance.
|
void |
setHasDropLines(boolean value)
True if the chart has drop lines.
|
void |
setHasHiLoLines(boolean value)
True if the line chart has high-low lines.
|
void |
setHasLeaderLines(boolean value)
True if the series has leader lines.
|
void |
setHasRadarAxisLabels(boolean value)
True if a radar chart has category axis labels.
|
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.
|
void |
setHasUpDownBars(boolean value)
True if a line chart has up and down bars.
|
void |
setName(java.lang.String value)
Sets the name of the data series.
|
void |
setOverlap(short value)
Specifies how bars and columns are positioned.
|
void |
setPlotOnSecondAxis(boolean value)
Indicates if this series is plotted on second value axis.
|
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.
|
void |
setShadow(boolean value)
True if the series has a shadow.
|
void |
setShowNegativeBubbles(boolean value)
True if negative bubbles are shown for the chart group.
|
void |
setSizeRepresents(int value)
Sets what the bubble size represents on a bubble chart.
|
void |
setSmooth(boolean value)
Represents curve smoothing.
|
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.
|
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.
|
void |
setType(int value)
Sets a data series' type.
|
void |
setValues(java.lang.String value)
Represents the Y values of this chart series.
|
void |
setValuesFormatCode(java.lang.String value)
Represents format code of Values's NumberList.
|
void |
setXValues(java.lang.String value)
Represents the x values of the chart series.
|
void |
setXValuesFormatCode(java.lang.String value)
Represents format code of X Values's NumberList.
|
public boolean isFiltered()
public void setFiltered(boolean value)
public SeriesLayoutProperties getLayoutProperties()
public void move(int count)
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.public ChartPointCollection getPoints()
Remarks
When the chart is Pie of Pie or Bar of Pie, the last point is other point in first pie plot.public Area getArea()
public Line getBorder()
public java.lang.String getName()
Example
//Reference name to a cell
chart.getNSeries().get(0).setName("=A1");
//Set a string to name
chart.getNSeries().get(0).setName("First Series");
public void setName(java.lang.String value)
public java.lang.String getDisplayName()
public int getCountOfDataValues()
public boolean isVerticalValues()
public java.lang.String getValues()
public void setValues(java.lang.String value)
public java.util.ArrayList getCachedValues()
Remarks
NOTE: This property is currently for internal use only. It will be changed or removed in next version.public java.util.ArrayList getCachedCategoryValues()
Remarks
NOTE: This property is currently for internal use only. It will be changed or removed in next version.public java.lang.String getValuesFormatCode()
public void setValuesFormatCode(java.lang.String value)
public java.lang.String getXValuesFormatCode()
public void setXValuesFormatCode(java.lang.String value)
public java.lang.String getXValues()
public void setXValues(java.lang.String value)
public java.lang.String getBubbleSizes()
public void setBubbleSizes(java.lang.String value)
public TrendlineCollection getTrendLines()
public boolean getSmooth()
public void setSmooth(boolean value)
public boolean getShadow()
public void setShadow(boolean value)
public boolean getHas3DEffect()
public void setHas3DEffect(boolean value)
public int getBar3DShapeType()
See Bar3DShapeType.
public void setBar3DShapeType(int value)
See Bar3DShapeType.
public DataLabels getDataLabels()
public int getType()
See ChartType.
public void setType(int value)
See ChartType.
public Marker getMarker()
getMarker().public boolean getPlotOnSecondAxis()
public void setPlotOnSecondAxis(boolean value)
public ErrorBar getXErrorBar()
public ErrorBar getYErrorBar()
public boolean hasHiLoLines()
public void setHasHiLoLines(boolean value)
public Line getHiLoLines()
public boolean hasSeriesLines()
public void setHasSeriesLines(boolean value)
public Line getSeriesLines()
public boolean hasDropLines()
public void setHasDropLines(boolean value)
public Line getDropLines()
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.public boolean hasUpDownBars()
public void setHasUpDownBars(boolean value)
public DropBars getUpBars()
public DropBars getDownBars()
DropBars object that represents the down bars on a line chart.
Applies only to line charts.public boolean isColorVaried()
public void setColorVaried(boolean value)
public short getGapWidth()
public void setGapWidth(short value)
public short getFirstSliceAngle()
public void setFirstSliceAngle(short value)
public short getOverlap()
public void setOverlap(short value)
public short getSecondPlotSize()
public void setSecondPlotSize(short value)
public int getSplitType()
See ChartSplitType.
public void setSplitType(int value)
See ChartSplitType.
public double getSplitValue()
public void setSplitValue(double value)
public boolean isAutoSplit()
public int getBubbleScale()
public void setBubbleScale(int value)
public int getSizeRepresents()
See BubbleSizeRepresents.
Remarks
BubbleSizeRepresents.SizeIsArea means the valuegetBubbleSizes() is the area of the bubble.
BubbleSizeRepresents.SizeIsWidth means the value getBubbleSizes() is the width of the bubble.public void setSizeRepresents(int value)
See BubbleSizeRepresents.
Remarks
BubbleSizeRepresents.SizeIsArea means the valuegetBubbleSizes() is the area of the bubble.
BubbleSizeRepresents.SizeIsWidth means the value getBubbleSizes() is the width of the bubble.public boolean getShowNegativeBubbles()
public void setShowNegativeBubbles(boolean value)
public int getDoughnutHoleSize()
public void setDoughnutHoleSize(int value)
public int getExplosion()
public void setExplosion(int value)
public boolean hasRadarAxisLabels()
public void setHasRadarAxisLabels(boolean value)
public boolean hasLeaderLines()
public void setHasLeaderLines(boolean value)
public Line getLeaderLines()
public LegendEntry getLegendEntry()
public ShapePropertyCollection getShapeProperties()
ShapePropertyCollection object that holds the visual shape properties of the Series.public int getBubbleSizeRepresents()
See BubbleSizeRepresents.
Remarks
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.public void setBubbleSizeRepresents(int value)
See BubbleSizeRepresents.
Remarks
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.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.