com.extentech.ExtenXLS
Class ChartSeriesHandle

java.lang.Object
  extended by com.extentech.ExtenXLS.ChartSeriesHandle

public class ChartSeriesHandle
extends Object

Chart Series Handle allows for manipulation of Chart Series within a Chart Handle.
Charts are typically made up of two data elements, series data and category data. When Microsoft Excel creates a chart, it assigns either the worksheet rows as series data (and the columns as category data), or the worksheet columns as the series data (and the rows as categories).
Excel tries to minimize the number of series by default, unless both rows and columns are equal, in which case the default is to have the rows as series.
Typically there will be one series object per row (or column if that is the series) of data. In most cases, the categories will be the same for every series.
As there are series for every row of data, when performing actions such as adding a column to a chart that has it's series arranged by row, it will be necessary to modify every series within the chart. ChartSeriesHandle is available to make this process easier.

Version:
4.1
Author:
Nicholas Rab -- Copyright ©2011Extentech Inc.
See Also:
ChartHandle

Constructor Summary
ChartSeriesHandle(com.extentech.formats.XLS.charts.Series series, WorkBook wbk)
          Constructor, used internally.
 
Method Summary
 void addDpt(com.extentech.formats.OOXML.DPt d)
          adds an OOXML (Open Office XML) Data Point Property Element to this Series
 String getBubbleSizes()
          returns the Cell Range String representing Bubble Size for this Series (Bubble Charts only)
 int getCategoryDataType()
          gets the Chart Category Data Type
 String getCategoryRange()
          returns the Cell Range String representing the Categories (usually the X Axis) for the Chart
Note that Category typically stays constant for all Series in the Chart
 com.extentech.formats.OOXML.DLbls getDLbls()
          returns the OOXML (Open Office XML) Data Label Properties Object for this Series
 com.extentech.formats.OOXML.DPt[] getDPt()
          returns an array of OOXML (Open Office XML) Data Point Properties Objects defining this Series
 com.extentech.formats.OOXML.Marker getMarker()
          returns the OOXML (Open Office XML) Marker Properties Object for this Series
 int getPieChartSliceColor(int slice)
          returns the desired Pie chart slice color
 int getSeriesColor()
          returns the Series (bar or line) color
NOTE: for Pie charts, use getPieChartSliceColor
 int getSeriesDataType()
          gets the Series Data Type
 String getSeriesLegend()
          returns the Legend text for this Series
 String getSeriesLegendReference()
          returns the Legend Cell Reference, if any
 String getSeriesRange()
          returns the Cell Range String representing the Data in this Series Object.
 int getShape()
          returns a constant that represents the bar shape for this Series
This is an internal method that is not useful to the end user.
 com.extentech.formats.OOXML.SpPr getSpPr()
          returns the OOXML (Open Office XML) Shape Properties Object for this Series
 boolean hasBubbleSizes()
          returns true if this chart has Bubble Sizes
 void setBubbleRange(String bubbleSizes)
          set the Cell Range for the Bubbles in this Seeries (Bubble Chart Only)
 void setCategoryDataType(int i)
          sets the Chart Category Data Type
 void setCategoryRange(String categoryRange)
          sets the Category from a new Cell Range.
 void setDLbls(com.extentech.formats.OOXML.DLbls d)
          sets the OOXML (Open Office XML) Data Label Properties Object for this Series
 void setMarker(com.extentech.formats.OOXML.Marker m)
          sets the OOXML (Open Office XML) Marker Properties Object for this Series
 void setPieChartSliceColor(int clr, int slice)
          sets the color for a particular Pie Chart slice or wedge
 void setSeries(String legendRef, String series, String cat, String bubble)
          defines this Series with Cell References for the Legend, Data Points, Category and Bubble Sizes, if applicable.
 void setSeriesColor(int clr)
          sets the color for this Series (bar or line)
NOTE: for Pie Charts, use setPieChartSliceColor
 void setSeriesColor(int seriesNumber, int clr)
          Deprecated. use setSeriesColor(int clr) instead
 void setSeriesDataType(int i)
          sets the Series Data Type
 void setSeriesLegend(String legend)
          Set the Legend text for this Series
 void setSeriesLegendRef(String legendCell)
          sets Cell Address for the Series Legend
 void setSeriesRange(String seriesRange)
          sets the data for this Series to be obtained from a new Cell Range.
 void setShape(int shape)
          sets the constant that represents the bar shape for this Series
This is an internal method that is not useful to the end user.
 void setSpPr(com.extentech.formats.OOXML.SpPr sp)
          sets the OOXML (Open Office XML) Shape Properties Object for this Series
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartSeriesHandle

public ChartSeriesHandle(com.extentech.formats.XLS.charts.Series series,
                         WorkBook wbk)
Constructor, used internally. For public use get series from a ChartHandle

Parameters:
Series - series
WorkBook - wbk - WorkBook the Chart is attached to
Method Detail

getSeriesRange

public String getSeriesRange()
returns the Cell Range String representing the Data in this Series Object.

Returns:
String Cell Range representing Series Data e.g. Sheet1!A1:A12

getCategoryRange

public String getCategoryRange()
returns the Cell Range String representing the Categories (usually the X Axis) for the Chart
Note that Category typically stays constant for all Series in the Chart

Returns:
String Category Cell Range e.g. Sheet1!A1:C1

getBubbleSizes

public String getBubbleSizes()
returns the Cell Range String representing Bubble Size for this Series (Bubble Charts only)

Returns:
String Bubble Sizes Cell Range e.g. Sheet1!A1:C1

hasBubbleSizes

public boolean hasBubbleSizes()
returns true if this chart has Bubble Sizes

Returns:

setSeriesRange

public void setSeriesRange(String seriesRange)
sets the data for this Series to be obtained from a new Cell Range.
Note that if you set the size of this series to a different amount of data than other Series in the chart you could have unexpected results.

Parameters:
String - seriesRange - a Cell Range representing Series Data e.g. Sheet1!A1:A12

setCategoryRange

public void setCategoryRange(String categoryRange)
sets the Category from a new Cell Range.

IMPORTANT! In most cases, the category should be set to the same Cell Range for all Series in the chart.
This method is available for complex charts, but in most cases the ideal way to handle this call is through
chartHandle.changeCategoryRange.

Parameters:
String - categoryRange - new Category Cell Range

setBubbleRange

public void setBubbleRange(String bubbleSizes)
set the Cell Range for the Bubbles in this Seeries (Bubble Chart Only)

Parameters:
String - bubbleSizes - Cell Range for Bubble Sizes

setSeriesLegend

public void setSeriesLegend(String legend)
Set the Legend text for this Series

Parameters:
String - legend - Legend Text
See Also:
setSeriesLegendRef

getSeriesLegend

public String getSeriesLegend()
returns the Legend text for this Series

Returns:
String Legend text for this Series
See Also:
getSeriesLegendReference

getSeriesLegendReference

public String getSeriesLegendReference()
returns the Legend Cell Reference, if any

Returns:
String Cell Address representing the Legend for this Series

setSeriesLegendRef

public void setSeriesLegendRef(String legendCell)
sets Cell Address for the Series Legend

Parameters:
String - legendCell - Cell Address for Legend

getCategoryDataType

public int getCategoryDataType()
gets the Chart Category Data Type

Returns:
int Data Type of the Category

getSeriesDataType

public int getSeriesDataType()
gets the Series Data Type

Returns:
int Data Type of this Series

setCategoryDataType

public void setCategoryDataType(int i)
sets the Chart Category Data Type

Parameters:
int - i - Category Data Type

setSeriesDataType

public void setSeriesDataType(int i)
sets the Series Data Type

Parameters:
int - i - Series Data Type

getShape

public int getShape()
returns a constant that represents the bar shape for this Series
This is an internal method that is not useful to the end user.

Returns:
int DataPoint shape for this Series (3d Bar, Pyramid ...)

setShape

public void setShape(int shape)
sets the constant that represents the bar shape for this Series
This is an internal method that is not useful to the end user.

Parameters:
int - shape - DataPoint shape for this Series (3d Bar, Pyramid ...)

setSeries

public void setSeries(String legendRef,
                      String series,
                      String cat,
                      String bubble)
defines this Series with Cell References for the Legend, Data Points, Category and Bubble Sizes, if applicable.

Parameters:
String - legendRef - Cell Address representing the Legend for this Series
String - series - Cell Range representing the Data Points for this Series
String - cat - Cell Range representing the Category for this Series (NOTE: The Category Cell Range is typically the same for every Series in the Chart)
String - bubble - Cell Range representing the Bubble Sizes for this Series (Bubble Chart only) or null if none

setSeriesColor

public void setSeriesColor(int seriesNumber,
                           int clr)
Deprecated. use setSeriesColor(int clr) instead

sets the color for this series

Parameters:
int - seriesNumber - series index
int - clr - color constant
See Also:
setSeriesColor(int clr)

setSeriesColor

public void setSeriesColor(int clr)
sets the color for this Series (bar or line)
NOTE: for Pie Charts, use setPieChartSliceColor

Parameters:
int - clr - color constant
See Also:
setPieChartSliceColor, constants

setPieChartSliceColor

public void setPieChartSliceColor(int clr,
                                  int slice)
sets the color for a particular Pie Chart slice or wedge

Parameters:
int - clr - color constant
int - slice - 0-based slice or point number
See Also:
constants

getSeriesColor

public int getSeriesColor()
returns the Series (bar or line) color
NOTE: for Pie charts, use getPieChartSliceColor

Returns:
int color constant representing the Series color
See Also:
constants, getPieChartSliceColor

getPieChartSliceColor

public int getPieChartSliceColor(int slice)
returns the desired Pie chart slice color

Parameters:
int - slice - 0-based slice or wedge index
Returns:
int color constant repressenting the color for the desired pie slice
See Also:
constants

getSpPr

public com.extentech.formats.OOXML.SpPr getSpPr()
returns the OOXML (Open Office XML) Shape Properties Object for this Series

Returns:
SpPr OOXML Shape Properties Object
See Also:
SpPr

setSpPr

public void setSpPr(com.extentech.formats.OOXML.SpPr sp)
sets the OOXML (Open Office XML) Shape Properties Object for this Series

Parameters:
SpPr - sp - OOXML Shape Properties Object
See Also:
SpPr

getMarker

public com.extentech.formats.OOXML.Marker getMarker()
returns the OOXML (Open Office XML) Marker Properties Object for this Series

Returns:
Marker -OOXML Marker Properties Object
See Also:
Marker

setMarker

public void setMarker(com.extentech.formats.OOXML.Marker m)
sets the OOXML (Open Office XML) Marker Properties Object for this Series

Parameters:
Marker - m - the OOXML Marker Properties Object
See Also:
Marker

getDLbls

public com.extentech.formats.OOXML.DLbls getDLbls()
returns the OOXML (Open Office XML) Data Label Properties Object for this Series

Returns:
DLbls - OOXML Data Label Properties Object

setDLbls

public void setDLbls(com.extentech.formats.OOXML.DLbls d)
sets the OOXML (Open Office XML) Data Label Properties Object for this Series

Parameters:
Dlbls - d- OOXML Data Label Properties Object
See Also:
DLbls

getDPt

public com.extentech.formats.OOXML.DPt[] getDPt()
returns an array of OOXML (Open Office XML) Data Point Properties Objects defining this Series

Returns:
DPt[] - Array of OOXML Data Point Properties Objects
See Also:
Dpt

addDpt

public void addDpt(com.extentech.formats.OOXML.DPt d)
adds an OOXML (Open Office XML) Data Point Property Element to this Series

Parameters:
DPt - d- Data Point Properties Object
See Also:
DPt


Copyright © 2011 Extentech Inc. All Rights Reserved.