public class Series
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 | ||
---|---|---|
Area | getArea() | |
Represents the background area of Series object.
|
||
int | getBar3DShapeType() | |
void | setBar3DShapeType(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. | ||
int | getBarShape() | |
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. | ||
Line | getBorder() | |
Represents border of Series object.
|
||
int | getBubbleScale() | |
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. | ||
int | getBubbleSizeRepresents() | |
void | setBubbleSizeRepresents(intvalue) | |
Gets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant. | ||
java.lang.String | getBubbleSizes() | |
void | setBubbleSizes(java.lang.Stringvalue) | |
Gets or sets the bubble sizes values of the chart series. | ||
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() | |
void | setDoughnutHoleSize(intvalue) | |
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. | ||
DropBars | getDownBars() | |
Returns a |
||
Line | getDropLines() | |
Returns a |
||
int | getExplosion() | |
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. | ||
short | getFirstSliceAngle() | |
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. | ||
short | getGapWidth() | |
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. | ||
boolean | getHas3DEffect() | |
void | setHas3DEffect(booleanvalue) | |
True if the series has a three-dimensional appearance. Applies only to bubble charts. | ||
boolean | hasDropLines() | |
void | setHasDropLines(booleanvalue) | |
True if the chart has drop lines. Applies only to line chart or area charts. | ||
boolean | hasHiLoLines() | |
void | setHasHiLoLines(booleanvalue) | |
True if the line chart has high-low lines. Applies only to line charts. | ||
boolean | hasLeaderLines() | |
void | setHasLeaderLines(booleanvalue) | |
True if the series has leader lines. | ||
boolean | hasRadarAxisLabels() | |
void | setHasRadarAxisLabels(booleanvalue) | |
True if a radar chart has category axis labels. Applies only to radar charts. | ||
boolean | hasSeriesLines() | |
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. | ||
boolean | hasUpDownBars() | |
void | setHasUpDownBars(booleanvalue) | |
True if a line chart has up and down bars. Applies only to line charts. | ||
Line | getHiLoLines() | |
Returns a HiLoLines object that represents the high-low lines for a series on a line chart.
Applies only to line charts.
|
||
boolean | isAutoSplit() | |
Indicates whether the threshold value is automatic.
|
||
boolean | isColorVaried() | |
void | setColorVaried(booleanvalue) | |
Represents if the color of points is varied. The chart must contain only one series. | ||
boolean | isVerticalValues() | |
Indicates whether the data source is vertical.
|
||
SeriesLayoutProperties | getLayoutProperties() | |
Reprsetns the properties of layout.
|
||
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.
|
||
LegendEntry | getLegendEntry() | |
Gets the legend entry according to this series.
|
||
Line | getLine() | |
Represents border of Series object.
|
||
Marker | getMarker() | |
Gets the |
||
com.aspose.cells.Color | getMarkerBackgroundColor() | |
void | setMarkerBackgroundColor(com.aspose.cells.Colorvalue) | |
Represents the marker background color in a line chart, scatter chart, or radar chart. | ||
int | getMarkerBackgroundColorSetType() | |
void | setMarkerBackgroundColorSetType(intvalue) | |
Gets or sets the marker background color set type. The value of the property is FormattingType integer constant. | ||
com.aspose.cells.Color | getMarkerForegroundColor() | |
void | setMarkerForegroundColor(com.aspose.cells.Colorvalue) | |
Represents the marker foreground color in a line chart, scatter chart, or radar chart. | ||
int | getMarkerForegroundColorSetType() | |
void | setMarkerForegroundColorSetType(intvalue) | |
Gets or sets the marker foreground color set type. The value of the property is FormattingType integer constant. | ||
int | getMarkerSize() | |
void | setMarkerSize(intvalue) | |
Represents the marker size in a line chart, scatter chart, or radar chart. | ||
int | getMarkerStyle() | |
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.String | getName() | |
void | setName(java.lang.Stringvalue) | |
Gets or sets the name of the data series. | ||
short | getOverlap() | |
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. | ||
boolean | getPlotOnSecondAxis() | |
void | setPlotOnSecondAxis(booleanvalue) | |
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() | |
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. | ||
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.
|
||
boolean | getShadow() | |
void | setShadow(booleanvalue) | |
True if the series has a shadow. | ||
ShapePropertyCollection | getShapeProperties() | |
Gets the object that holds the visual shape properties of the Series.
|
||
boolean | getShowNegativeBubbles() | |
void | setShowNegativeBubbles(booleanvalue) | |
True if negative bubbles are shown for the chart group. Valid only for bubble charts. | ||
int | getSizeRepresents() | |
void | setSizeRepresents(intvalue) | |
Gets or sets what the bubble size represents on a bubble chart. The value of the property is BubbleSizeRepresents integer constant. | ||
boolean | getSmooth() | |
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. | ||
int | getSplitType() | |
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. | ||
double | getSplitValue() | |
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. | ||
TrendlineCollection | getTrendLines() | |
Returns an object that represents a collection of all the trendlines for the series.
|
||
int | getType() | |
void | setType(intvalue) | |
Gets or sets a data series' type. The value of the property is ChartType integer constant. | ||
DropBars | getUpBars() | |
Returns an DropBars object that represents the up bars on a line chart.
Applies only to line charts.
|
||
java.lang.String | getValues() | |
void | setValues(java.lang.Stringvalue) | |
Represents the data of the chart series. | ||
java.lang.String | getValuesFormatCode() | |
void | setValuesFormatCode(java.lang.Stringvalue) | |
Represents format code of Values¡®s NumberList. | ||
ErrorBar | getXErrorBar() | |
Represents X direction error bar of the series.
|
||
java.lang.String | getXValues() | |
void | setXValues(java.lang.Stringvalue) | |
Represents the x values of the chart series. | ||
ErrorBar | getYErrorBar() | |
Represents Y direction error bar of the series.
|
Method Summary | ||
---|---|---|
void | move(int count) | |
Moves the series up or down.
|
public SeriesLayoutProperties getLayoutProperties()
public ChartPointCollection getPoints()
public Area getArea()
public Line getLine()
public Line getBorder()
public java.lang.String getName() / public void setName(java.lang.String value)
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 java.lang.String getDisplayName()
public int getCountOfDataValues()
public boolean isVerticalValues()
public java.lang.String getValues() / public void setValues(java.lang.String value)
public java.lang.String getValuesFormatCode() / public void setValuesFormatCode(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() / public void setBar3DShapeType(int value)
public int getBarShape() / public void setBarShape(int value)
public DataLabels getDataLabels()
public int getType() / public void setType(int value)
public Marker getMarker()
public int getMarkerStyle() / public void setMarkerStyle(int value)
public int getMarkerSize() / public void setMarkerSize(int value)
public com.aspose.cells.Color getMarkerForegroundColor() / public void setMarkerForegroundColor(com.aspose.cells.Color value)
public int getMarkerForegroundColorSetType() / public void setMarkerForegroundColorSetType(int value)
public com.aspose.cells.Color getMarkerBackgroundColor() / public void setMarkerBackgroundColor(com.aspose.cells.Color value)
public int getMarkerBackgroundColorSetType() / public void setMarkerBackgroundColorSetType(int value)
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()
public boolean hasUpDownBars() / public void setHasUpDownBars(boolean value)
public DropBars getUpBars()
public DropBars getDownBars()
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() / public void setSplitType(int value)
public double getSplitValue() / public void setSplitValue(double value)
public boolean isAutoSplit()
public int getBubbleScale() / public void setBubbleScale(int value)
public int getSizeRepresents() / public void setSizeRepresents(int value)
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()
public int getBubbleSizeRepresents() / public void setBubbleSizeRepresents(int value)