com.extentech.ExtenXLS
Class ChartHandle

java.lang.Object
  extended by com.extentech.ExtenXLS.ChartHandle
All Implemented Interfaces:
com.extentech.formats.XLS.charts.ChartConstants

public class ChartHandle
extends Object
implements com.extentech.formats.XLS.charts.ChartConstants

Chart Handle allows for manipulation of Charts within a WorkBook.
Allows for run-time modification of Chart titles, labels, categories, and data Cells.
Modification of Chart data cells allows you to completely modify the data shown on the Chart.

Version:
4.1
Author:
John McMahon -- Copyright ©2011Extentech Inc.
See Also:
WorkBookHandle

Field Summary
static int AREA
           
static int BAR
           
static int BUBBLE
           
static int COL
           
static int CONE
           
static int CONEBAR
           
static int CYLINDER
           
static int CYLINDERBAR
           
static int DOUGHNUT
           
static int HEIGHT
           
static int LINE
           
static int PIE
           
static int PYRAMID
           
static int PYRAMIDBAR
           
static int RADAR
           
static int RADARAREA
           
static int SCATTER
           
static int SURFACE
           
static int WIDTH
           
static int X
           
static int XAXIS
           
static int XVALAXIS
           
static int Y
           
static int YAXIS
           
static int ZAXIS
           
 
Fields inherited from interface com.extentech.formats.XLS.charts.ChartConstants
SHAPECOLUMN, SHAPECONE, SHAPECONETOMAX, SHAPECYLINDER, SHAPEPYRAMID, SHAPEPYRAMIDTOMAX
 
Constructor Summary
ChartHandle(com.extentech.formats.XLS.charts.Chart c, WorkBookHandle wb)
          Constructor which creates a new ChartHandle from an existing Chart Object
 
Method Summary
 void addAllSeries(String[] valueRanges, String[] legendCells, String[] bubbleSizeRanges, String categoryRange)
          updates (replaces) every Chart Series (bar, line or wedge on the Chart) with the data from the array of values, legends, bubble sizes (optional) and category range.
 void addChartEmbed(String[] ce)
          sets external information linked to or "embedded" in this OOXML chart; can be a chart user shape, an image ...
 ChartSeriesHandle addSeriesRange(CellHandle legendCell, CellRange categoryRange, CellRange seriesRange, CellRange bubbleRange)
          Adds a new Series to the chart via CellHandles and CellRange Objects.
 ChartSeriesHandle addSeriesRange(CellHandle legendCell, CellRange categoryRange, CellRange seriesRange, CellRange bubbleRange, int nChart)
          Adds a new Series to the chart via CellHandles and CellRange Objects.
 ChartSeriesHandle addSeriesRange(String legendCell, String categoryRange, String seriesRange, String bubbleRange)
          Adds a new Series to the chart.
 ChartSeriesHandle addSeriesRange(String legendCell, String categoryRange, String seriesRange, String bubbleRange, int nChart)
          Adds a new Series to the chart.
 void appendRowCategoryToChart()
          Append a row of categories to the bottom of the chart.
 void appendRowCategoryToChart(int nChart)
          Append a row of categories to the bottom of the chart.
 ChartSeriesHandle appendRowSeriesToChart()
          Appends a series one row below the last series in the chart.
 ChartSeriesHandle appendRowSeriesToChart(int nChart)
          Appends a series one row below the last series in the chart for the desired chart
 boolean changeCategoryRange(String originalrange, String newrange)
          Change the Cell Range representing the Categories in the Chart.
 boolean changeSeriesRange(String originalrange, String newrange)
          Change the Cell Range referenced by one of the Series (a bar, line or wedge of data) in the Chart.
 boolean changeTextValue(String originalval, String newval)
          Change the value of a Chart object.
 ChartSeriesHandle[] getAllChartSeriesHandles()
          Returns an array of ChartSeriesHandle Objects, one for each bar, line or wedge of data.
 ChartSeriesHandle[] getAllChartSeriesHandles(int nChart)
          Returns an array of ChartSeriesHandle Objects for the desired chart, one for each bar, line or wedge of data.
 String getAllSeriesDataJSON()
          returns a JSON representation of all Series Data (Legend, Categogies, Series Values) for the chart
This is an internal method that is not useful to the end user.
 com.extentech.formats.XLS.charts.Axis getAxis(int axisType)
          returns the desired axis (creates if doesn't exist)
 boolean getAxisAutomaticScale()
          Returns true if the Y Axis (Value axis) is set to automatic scale
 boolean getAxisAutomaticScale(int axisType)
          Returns true if the desired Value axis is set to automatic scale
 com.extentech.formats.XLS.Font getAxisFont()
          return the Font associated with the Chart Axes
 int getAxisMajorUnit()
          Returns the major tick unit of the Y Axis (Value Axis)
 int getAxisMajorUnit(int axisType)
          Returns the major tick unit of the desired Value axis
 double getAxisMaxScale()
          Returns the maximum value of the Y Axis (Value Axis) scale
 double getAxisMaxScale(int axisType)
          Returns the maximum scale value of the desired Value axis
 int getAxisMinorUnit()
          Returns the minor tick unit of the Y Axis (Value Axis)
 int getAxisMinorUnit(int axisType)
          Returns the minor tick unit of the desired Value axis
 double getAxisMinScale()
          Returns the minimum value of the Y Axis (Value Axis) scale
 double getAxisMinScale(int axisType)
          Returns the minimum scale value of the the desired Value axis
 String getAxisOptions(int Axis)
           
 int getAxisPlacement(int Axis)
          Returns the Axis Label Placement or position as an int
 short[] getBounds()
          returns the coordinates or bounds (position, width and height) of this chart in pixels
 String[] getCategories()
          Returns an ordered array of strings representing all the category ranges in the chart.
 byte[] getChartBytes()
          Get the Chart's bytes This is an internal method that is not useful to the end user.
 String getChartDrawingOOXML(int id)
          generates the OOXML specific for DrawingML, specifying offsets and identifying the chart object.
 ArrayList getChartEmbeds()
          returns the drawingml file name which defines the userShape (if any)
a userShape is a drawing or shape ontop of a chart associated with this chart
 String getChartFontRecsXML()
          returns Chart-specific Font Records in XML form
 String getChartFontsXML()
          Return non-axis Chart font ids in XML form
 ChartSeriesHandle getChartSeriesHandle(int idx)
          Get the ChartSeriesHandle representing Chart Series Data (Series and Categories) for the specified Series index
 ChartSeriesHandle getChartSeriesHandle(String seriesRange)
          Get the ChartSeriesHandle representing Chart Series Data (Series and Categories) for the specified Series range
 ChartSeriesHandle getChartSeriesHandleByName(String legend)
          Get the ChartSeriesHandle representing Chart Series Data (Series and Categories) for the Series specified by label (legend)
 int getChartType()
          Return an int corresponding to this ChartHandle's Chart Type for the default chart
To see possible Chart Types, view the public static int's in ChartHandle.
 int getChartType(int nChart)
          Return an int corresponding to this ChartHandle's Chart Type for the specified chart
To see possible Chart Types, view the public static int's in ChartHandle.
 short[] getCoords()
          returns the coordinates (position, width and height) of this chart in pixels
 org.json.JSONObject getCurrentSeries()
          retrieves current series and axis scale info in JSONObject form used upon chart updating
This is an internal method that is not useful to the end user.
 int getId()
          returns the ordinal id associated with the underlying Chart Object
 String getJSON()
          returs the JSON representation of this chart, based upon Dojo-charting-specifics
 String getOOXML(int rId)
          Generates OOXML (chartML) for this chart object.
 String getOOXMLName()
          return the Excel 7/OOXML-specific name for this chart
 String getPdfXML()
          returns the correct XML for Pdf Input
 int getPlotAreaBgColor()
          return the background color of this chart's Plot Area as an int
 short[] getRelativeBounds()
          get the bounds of the chart using coordinates relative to row/cols and their offsets
 byte[] getSerialBytes()
           
 String[] getSeries()
          Returns an ordered array of strings representing all the series ranges in the Chart.
 org.json.JSONArray getSeriesJSON()
          retrieves the saved Series JSON for comparisons
This is an internal method that is not useful to the end user.
 com.extentech.formats.XLS.Boundsheet getSheet()
          returns the underlhying Sheet Object this Chart is attached to
For Internal Use
 String getSVG()
          TODO: Less Common Charts: STOCK RADAR SURFACE COLUMN- 3D, CONE, CYLINDER, PYRAMID BAR- 3D, CONE, CYLINDER, PYRAMID 3D PIE 3D LINE 3D AREA LINE CHART APPEARS THAT STARTS AND ENDS A BIT TOO EARLY ***************** Z Axis CHART OPTIONS: STACKED CLUSTERED
 String getSVG(double scale)
          /** Take current Chart object and return the SVG code necessary to define it, scaled to the desired percentage e.g.
 String getThreeDXML()
           
 String getTitle()
          Returns the title of the Chart
 com.extentech.formats.XLS.Font getTitleFont()
          returns the Font associated with the Chart Title
 com.extentech.formats.XLS.WorkBook getWorkBook()
           
 String getXAxisLabel()
          returns the X axis Label
 String getXML()
          returns an XML representation of this chart
 String getYAxisLabel()
          returns the Y axis Label
 String getZAxisLabel()
          returns the Z axis Label, if any
 boolean hasDataLegend()
          returns true if Chart has a Data Legend Key showing
 com.extentech.formats.XLS.charts.ThreeD initThreeD(int nChart)
          Make chart 3D if not already
 boolean is100PercentStacked()
           
 boolean isClustered()
           
 boolean isStacked()
           
 boolean isThreeD()
           
 void make100PercentStacked(int nChart)
          makes this Chart 100% Stacked
sets the group of options necessary to create a 100% stacked chart
For Chart Types:
BAR, COL, LINE, PYRAMID, PYRAMIDBAR, CYLINDER, CYLINDERBAR, CONE, CONEBAR
 void make100PercentStacked3D(int nChart)
          makes this Chart 100% Stacked with a 3D Effect
sets the group of options necessary to create a 100% Stacked 3D chart
For Chart Types:
BAR, COL, AREA
 void make3D()
          makes the default Chart hava a 3D effect
sets the group of options necessary to create a 3D chart
For Chart Types:
BAR, COL, LINE, PIE, AREA, BUBBLE, PYRAMID, CYLINDER, CONE
 void makeClustered3D(int nChart)
          makes this Chart Clusted with a 3D effect
sets the group of options necessary to create a Clusted 3D chart
For Chart Types:
BAR, COL
 void makeExploded()
          makes this chart's wedges exploded i.e.
 void makeExploded3D(int nChart)
          makes this chart's wedges exploded 3D i.e.
 void makeStacked(int nChart)
          makes this Chart Stacked
sets the group of options necessary to create a stacked chart
For Chart Types:
BAR, COL, LINE, AREA, PYRAMID, PYRAMIDBAR, CYLINDER, CYLINDERBAR, CONE, CONEBAR
 void makeStacked3D(int nChart)
          makes this Chart Stacked with a 3D Effect
sets the group of options necessary to create a Stacked 3D chart
For Chart Types:
BAR, COL, AREA
 void parseOOXML(InputStream ii)
          defines this chart object based on a Chart ML (OOXML) input Stream
This is an internal method that is not useful to the end user.
 void removeAxis(int axisType)
          removes the desired Axis from the Chart
 void removeSeries(int index)
          remove the Series (bar, line or wedge) at the desired index
 void removeSeries(int index, int nChart)
          remove the Series (bar, line or wedge) at the desired index
 void setAxisAutomaticScale(boolean b)
          Sets the automatic scale option on or off for the Y Axis (Value axis)
 void setAxisAutomaticScale(int axisType, boolean b)
          Sets the automatic scale option on or off for the desired Value axis
 void setAxisFont(com.extentech.formats.XLS.Font f)
          set the font for all axes on the Chart
 void setAxisFont(String name, int height, boolean bold, boolean italic, boolean underline)
          set the font for all axes on the chart
 void setAxisMax(int MaxValue)
          Sets the maximum value of the Y Axis (Value Axis) Scale
 void setAxisMax(int axisType, int MaxValue)
          Sets the maximum scale value of the desired Value axis
 void setAxisMin(int MinValue)
          Sets the minimum value of the Y Axis (Value Axis) Scale
 void setAxisMin(int axisType, int MinValue)
          Sets the minimum scale value of the desired Value axis
 void setAxisPlacement(int Axis, int Placement)
          Sets the Axis labels position or placement to the desired value (these match Excel placement options)
 void setBounds(short[] bounds)
          sets the coordinates or bounds (position, width and height) of this chart in pixels
 void setChartFont(String type, String val)
          Set non-axis chart font id for title, default, etc
For Internal Use Only
 void setChartOption(String op, String val)
          Method for setting Chart-Type-specific options in a generic fashion e.g.
 void setChartType(int chartType)
          Sets the Chart type to the specified type
To see possible Chart Types, view the public static int's in ChartHandle.
 void setChartType(int chartType, int nChart)
          Sets the chart type for multiple or overlay Charts.
 void setCoords(short[] coords)
          sets the coordinates (position, width and height) for this chart in pixels
 void setDataLabel(String type, boolean bShowLegendKey)
          set DataLabels option for this chart
 void setEditMovement(String editMovement)
          Specifies how to resize or move this Chart upon edit
This is an internal method that is not useful to the end user.
 boolean setLocationLocked(String loc, boolean l)
          Sets the location lock on the Cell Reference at the specified location Used to prevent updating of the Cell Reference when Cells are moved.
 void setMarkerFormat(int imf)
          set the marker format style for this chart
one of:
0 = no marker
1 = square
2 = diamond
3 = triangle
4 = X
5 = star
6 = Dow-Jones
7 = standard deviation
8 = circle
9 = plus sign
For Chart Types:
LINE, SCATTER
 void setOOXMLName(String name)
          set the Excel 7/OOXML-specific name for this chart
 void setPlotAreaBgColor(int bg)
          sets the Plot Area background color
 void setRelativeBounds(short[] bounds)
          sets the bounds of the chart using coordinates relative to row/cols and their offsets
 ChartSeriesHandle setSeries(int index, String legendCell, String categoryRange, String seriesRange, String bubbleRange)
          Changes or adds a Series to the chart via Series Index.
 ChartSeriesHandle setSeries(int index, String legendCell, String legendText, String categoryRange, String seriesRange, String bubbleRange)
          Changes or adds a Series to the chart via Series Index.
 ChartSeriesHandle setSeries(int index, String legendCell, String legendText, String categoryRange, String seriesRange, String bubbleRange, int nChart)
          Changes or adds a Series to the desired Chart (either default or overlay) via Series Index.
 void setSeriesJSON(org.json.JSONArray s)
          sets the saved Series JSON
This is an internal method that is not useful to the end user.
 void setTitle(String title)
          Sets the title of the Chart
 void setTitleFont(com.extentech.formats.XLS.Font f)
          set the font for the Chart Title
 void setTitleFont(String name, int height, boolean bold, boolean italic, boolean underline)
          set the font for the chart title
 void setXAxisLabel(String xLabel)
          Sets the XAxisLabel
 void setYAxisLabel(String yLabel)
          Sets the Y axis label
 void setZAxisLabel(String zLabel)
          set the Z AxisLabel
 void showDataTable(boolean bShow)
          shows or removes the Data Table for this chart
 void showLegend(boolean bShow, boolean vertical)
          shows or hides the Chart legend key
 String toString()
          returns the string representation of this ChartHandle
 void writeChartRecs(String fName)
          For internal debugging use only
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BAR

public static final int BAR
See Also:
Constant Field Values

COL

public static final int COL
See Also:
Constant Field Values

LINE

public static final int LINE
See Also:
Constant Field Values

PIE

public static final int PIE
See Also:
Constant Field Values

AREA

public static final int AREA
See Also:
Constant Field Values

SCATTER

public static final int SCATTER
See Also:
Constant Field Values

RADAR

public static final int RADAR
See Also:
Constant Field Values

SURFACE

public static final int SURFACE
See Also:
Constant Field Values

DOUGHNUT

public static final int DOUGHNUT
See Also:
Constant Field Values

BUBBLE

public static final int BUBBLE
See Also:
Constant Field Values

RADARAREA

public static final int RADARAREA
See Also:
Constant Field Values

PYRAMID

public static final int PYRAMID
See Also:
Constant Field Values

CYLINDER

public static final int CYLINDER
See Also:
Constant Field Values

CONE

public static final int CONE
See Also:
Constant Field Values

PYRAMIDBAR

public static final int PYRAMIDBAR
See Also:
Constant Field Values

CYLINDERBAR

public static final int CYLINDERBAR
See Also:
Constant Field Values

CONEBAR

public static final int CONEBAR
See Also:
Constant Field Values

XAXIS

public static final int XAXIS
See Also:
Constant Field Values

YAXIS

public static final int YAXIS
See Also:
Constant Field Values

ZAXIS

public static final int ZAXIS
See Also:
Constant Field Values

XVALAXIS

public static final int XVALAXIS
See Also:
Constant Field Values

X

public static final int X
See Also:
Constant Field Values

Y

public static final int Y
See Also:
Constant Field Values

WIDTH

public static final int WIDTH
See Also:
Constant Field Values

HEIGHT

public static final int HEIGHT
See Also:
Constant Field Values
Constructor Detail

ChartHandle

public ChartHandle(com.extentech.formats.XLS.charts.Chart c,
                   WorkBookHandle wb)
Constructor which creates a new ChartHandle from an existing Chart Object

Parameters:
Chart - c - the source Chart object
WorkBookHandle - wb - the parent WorkBookHandle
Method Detail

getTitle

public String getTitle()
Returns the title of the Chart

Returns:
String title of the Chart

setTitle

public void setTitle(String title)
Sets the title of the Chart

Parameters:
String - title - Chart title

getId

public int getId()
returns the ordinal id associated with the underlying Chart Object

Returns:
int chart id
See Also:
WorkBookHandle.getChartById

toString

public String toString()
returns the string representation of this ChartHandle

Overrides:
toString in class Object

getSeries

public String[] getSeries()
Returns an ordered array of strings representing all the series ranges in the Chart.
Each series can only represent one bar, line or wedge of data.

Returns:
String[] each item being a Cell Range representing one bar, line or wedge of data in the Chart
See Also:
ChartHandle.getCategories

getCategories

public String[] getCategories()
Returns an ordered array of strings representing all the category ranges in the chart.
This vector corresponds to the getSeries() method so will often contain duplicates, as while the series data changes frequently, category data is the same throughout the chart.

Returns:
String[] each item being a Cell Range representing the Category Data
See Also:
ChartHandle.getSeries

getAllChartSeriesHandles

public ChartSeriesHandle[] getAllChartSeriesHandles()
Returns an array of ChartSeriesHandle Objects, one for each bar, line or wedge of data.

Returns:
ChartSeriesHandle[] Array of ChartSeriesHandle Objects representing Chart Series Data (Series and Categories)
See Also:
ChartSeriesHandle

getAllChartSeriesHandles

public ChartSeriesHandle[] getAllChartSeriesHandles(int nChart)
Returns an array of ChartSeriesHandle Objects for the desired chart, one for each bar, line or wedge of data.
A chart number of 0 means the default chart, 1-9 indicate series for overlay charts
NOTE: using this method returns the series for the desired chart ONLY
You MUST use the corresponding removeSeries(index, nChart) when removing series to properly match the series index. Otherwise a mismatch will occur.

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
Returns:
ChartSeriesHandle[] Array of ChartSeriesHandle Objects representing Chart Series Data (Series and Categories)
See Also:
ChartSeriesHandle

getChartSeriesHandle

public ChartSeriesHandle getChartSeriesHandle(String seriesRange)
Get the ChartSeriesHandle representing Chart Series Data (Series and Categories) for the specified Series range

Parameters:
String - seriesRange - For example, "Sheet1!A12:A21"
Returns:
ChartSeriesHandle
See Also:
ChartSeriesHandle

getChartSeriesHandle

public ChartSeriesHandle getChartSeriesHandle(int idx)
Get the ChartSeriesHandle representing Chart Series Data (Series and Categories) for the specified Series index

Parameters:
int - idx - the index (0 based) of the series
Returns:
ChartSeriesHandle
See Also:
ChartSeriesHandle

getChartSeriesHandleByName

public ChartSeriesHandle getChartSeriesHandleByName(String legend)
Get the ChartSeriesHandle representing Chart Series Data (Series and Categories) for the Series specified by label (legend)

Parameters:
String - legend - label for the desired series
Returns:
ChartSeriesHandle
See Also:
ChartSeriesHandle

getYAxisLabel

public String getYAxisLabel()
returns the Y axis Label

Returns:
String label

setYAxisLabel

public void setYAxisLabel(String yLabel)
Sets the Y axis label

Parameters:
String - yLabel - new Y Axis Label

getXAxisLabel

public String getXAxisLabel()
returns the X axis Label

Returns:
String label

setXAxisLabel

public void setXAxisLabel(String xLabel)
Sets the XAxisLabel

Parameters:
String - xLabel - new X Axis Label

getZAxisLabel

public String getZAxisLabel()
returns the Z axis Label, if any

Returns:
String label

setZAxisLabel

public void setZAxisLabel(String zLabel)
set the Z AxisLabel

Parameters:
String - zLabel - new Z Axis Label

setAxisAutomaticScale

public void setAxisAutomaticScale(int axisType,
                                  boolean b)
Sets the automatic scale option on or off for the desired Value axis

The Value axis contains numbers rather than labels, and is normally the Y axis, but Scatter and Bubble charts may have a value axis on the X Axis as well

Automatic Scaling automatically sets the scale maximum, minimum and tick units upon data changes, and is the default setting for charts

Parameters:
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXIS
boolean - b - true if set Automatic scaling on, false otherwise
See Also:
setAxisAutomaticScale(boolean b)

getAxisMinScale

public double getAxisMinScale(int axisType)
Returns the minimum scale value of the the desired Value axis

The Value axis contains numbers rather than labels, and is normally the Y axis, but Scatter and Bubble charts may have a value axis on the X Axis as well

Parameters:
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXIS
Returns:
int Miminum Scale value for the desired axis
See Also:
getAxisMinScale()

getAxisMaxScale

public double getAxisMaxScale(int axisType)
Returns the maximum scale value of the desired Value axis

The Value axis contains numbers rather than labels, and is normally the Y axis, but Scatter and Bubble charts may have a value axis on the X Axis as well

Parameters:
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXIS
Returns:
int - Maximum Scale value for the desired axis
See Also:
getAxisMaxScale()

getAxisMajorUnit

public int getAxisMajorUnit(int axisType)
Returns the major tick unit of the desired Value axis

The Value axis contains numbers rather than labels, and is normally the Y axis, but Scatter and Bubble charts may have a value axis on the X Axis as well

Parameters:
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXIS
Returns:
int major tick unit
See Also:
getAxisMajorUnit()

getAxisMinorUnit

public int getAxisMinorUnit(int axisType)
Returns the minor tick unit of the desired Value axis

The Value axis contains numbers rather than labels, and is normally the Y axis, but Scatter and Bubble charts may have a value axis on the X Axis as well

Parameters:
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXIS
Returns:
int - minor tick unit of the desired axis
See Also:
getAxisMinorUnit()

setAxisMax

public void setAxisMax(int axisType,
                       int MaxValue)
Sets the maximum scale value of the desired Value axis

The Value axis contains numbers rather than labels, and is normally the Y axis, but Scatter and Bubble charts may have a value axis on the X Axis as well

Note: The default scale setting for charts is known as Automatic Scaling
When data changes, the chart automatically adjusts the scale as necessary
Setting the scale manually (either Minimum or Maximum Value) removes Automatic Scaling

Parameters:
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXIS
int - MaxValue - desired maximum value of the desired axis
See Also:
setAxisMax(int MaxValue)

setAxisMin

public void setAxisMin(int axisType,
                       int MinValue)
Sets the minimum scale value of the desired Value axis

The Value axis contains numbers rather than labels, and is normally the Y axis, but Scatter and Bubble charts may have a value axis on the X Axis as well

Note: The default setting for charts is known as Automatic Scaling
When data values change, the chart automatically adjusts the scale as necessary
Setting the scale manually (either Minimum or Maximum Value) removes Automatic Scaling

Parameters:
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXIS
int - MinValue - the desired Minimum scale value
See Also:
setAxisMin(int MinValue)

getAxisAutomaticScale

public boolean getAxisAutomaticScale(int axisType)
Returns true if the desired Value axis is set to automatic scale

The Value axis contains numbers rather than labels, and is normally the Y axis, but Scatter and Bubble charts may have a value axis on the X Axis as well

Note: The default setting for charts is known as Automatic Scaling
When data changes, the chart automatically adjusts the scale as necessary
Setting the scale manually (either Minimum or Maximum Value) removes Automatic Scaling

Parameters:
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXIS
Returns:
boolean true if Automatic Scaling is turned on
See Also:
getAxisAutomaticScale()

getAxisAutomaticScale

public boolean getAxisAutomaticScale()
Returns true if the Y Axis (Value axis) is set to automatic scale

The default setting for charts is known as Automatic Scaling
When data changes, the chart automatically adjusts the scale (minimum, maximum values plus major and minor tick units) as necessary

Returns:
boolean true if Automatic Scaling is turned on
See Also:
getAxisAutomaticScale(int axisType)

setAxisAutomaticScale

public void setAxisAutomaticScale(boolean b)
Sets the automatic scale option on or off for the Y Axis (Value axis)

Automatic Scaling will automatically set the scale maximum, minimum and tick units upon data changes, and is the default chart setting

Parameters:
b -
See Also:
setAxisAutomaticScale(int axisType boolean b)

getAxisMinScale

public double getAxisMinScale()
Returns the minimum value of the Y Axis (Value Axis) scale

Returns:
int Miminum Scale value for Y axis
See Also:
getAxisMinScale(int axisType)

getAxisMaxScale

public double getAxisMaxScale()
Returns the maximum value of the Y Axis (Value Axis) scale

Returns:
int Maximum Scale value for Y axis
See Also:
getAxisMaxScale(int axisType)

getAxisMajorUnit

public int getAxisMajorUnit()
Returns the major tick unit of the Y Axis (Value Axis)

Returns:
int major tick unit
See Also:
getAxisMajorUnit(int axisType)

getAxisMinorUnit

public int getAxisMinorUnit()
Returns the minor tick unit of the Y Axis (Value Axis)

Returns:
int minor tick unit
See Also:
getAxisMinorUnit(int axisType)

setAxisMax

public void setAxisMax(int MaxValue)
Sets the maximum value of the Y Axis (Value Axis) Scale

Note: The default scale setting for charts is known as Automatic Scaling
When data changes, the chart automatically adjusts the scale as necessary
Setting the scale manually (either Minimum or Maximum Value) removes Automatic Scaling

Parameters:
int - MaxValue - the desired maximum scale value
See Also:
ChartHandle.setAxisMax(int axisType, int MaxValue)

setAxisMin

public void setAxisMin(int MinValue)
Sets the minimum value of the Y Axis (Value Axis) Scale

Note: The default setting for charts is known as Automatic Scaling
When data changes, the chart automatically adjusts the scale as necessary
Setting the scale manually (either Minimum or Maximum Value) removes Automatic Scaling

Parameters:
int - MinValue - the desired minimum scale value
See Also:
ChartHandle.setAxisMin(int axisType, int MinValue)

setTitleFont

public void setTitleFont(String name,
                         int height,
                         boolean bold,
                         boolean italic,
                         boolean underline)
set the font for the chart title

Parameters:
String - name - font name
int - height - font height in 1/20 point units
boolean - bold - true if bold
boolean - italic - true if italic
boolean - underline - true if underlined

setTitleFont

public void setTitleFont(com.extentech.formats.XLS.Font f)
set the font for the Chart Title

Parameters:
com.extentech.Formats.XLS.Font - f - desired font for the Chart Title
See Also:
Font

getTitleFont

public com.extentech.formats.XLS.Font getTitleFont()
returns the Font associated with the Chart Title

Returns:
com.extentech.Formats.XLS.Font
See Also:
Font

setAxisFont

public void setAxisFont(String name,
                        int height,
                        boolean bold,
                        boolean italic,
                        boolean underline)
set the font for all axes on the chart

Parameters:
String - name - font name
int - height - font height in 1/20 point units
boolean - bold - true if bold
boolean - italic - true if italic
boolean - underline - true if underlined

setAxisFont

public void setAxisFont(com.extentech.formats.XLS.Font f)
set the font for all axes on the Chart

Parameters:
com.extentech.Formats.XLS.Font - f - desired font for the Chart axes
See Also:
Font

getAxisFont

public com.extentech.formats.XLS.Font getAxisFont()
return the Font associated with the Chart Axes

Returns:
com.extentech.Formats.XLS.Font for Chart Axes or null if no axes
See Also:
Font

getSheet

public com.extentech.formats.XLS.Boundsheet getSheet()
returns the underlhying Sheet Object this Chart is attached to
For Internal Use

Returns:
Boundsheet

getPlotAreaBgColor

public int getPlotAreaBgColor()
return the background color of this chart's Plot Area as an int

Returns:
int background color constant
See Also:
constants

setPlotAreaBgColor

public void setPlotAreaBgColor(int bg)
sets the Plot Area background color

Parameters:
int - bg - color constant
See Also:
constants

changeTextValue

public boolean changeTextValue(String originalval,
                               String newval)
Change the value of a Chart object.
You can use this method to change:
- the Title of the Chart
- the Text Labels of Categories and Values (X and Y)
eg:
To change the value of the Chart title
chart.changeObjectValue("Template Chart Title", "Widget Sales By Quarter");
To change the text label of the categories
chart.changeObjectValue("Category X", "Fiscal Year");
To change the text label of the values
chart.changeObjectValue("Value Y", "Sales in US$");

Parameters:
String - originalval - One of: "Template Chart Title", "Category X" or "Value Y"
Sring - newval - the new setting
Returns:
whether the change was successful

setChartType

public void setChartType(int chartType)
Sets the Chart type to the specified type
To see possible Chart Types, view the public static int's in ChartHandle.
Possible Chart Types:
BAR
COL
LINE
PIE
AREA
SCATTER
RADAR
SURFACE
DOUGHNUT
BUBBLE
RADARAREA
PYRAMID
CYLINDER
CONE
PYRAMIDBAR
CYLINDERBAR
CONEBAR

Parameters:
int - chartType - representing the chart type

setChartType

public void setChartType(int chartType,
                         int nChart)
Sets the chart type for multiple or overlay Charts.
You can specify the drawing order of the Chart, where 0 is the default chart, and 1-9 are overlay charts.
The default chart (chart 0) is always present; however, using this method, you can create a new overlay chart (up to 9 maximum).
NOTE: The chart number must be unique and in order
If the desired chart number is not present in the chart, a new overlay chart will be created.

To see possible Chart Types, view the public static int's in ChartHandle.
Possible Chart Types:
BAR
COL
LINE
PIE
AREA
SCATTER
RADAR
SURFACE
DOUGHNUT
BUBBLE
RADARAREA
PYRAMID
CYLINDER
CONE
PYRAMIDBAR
CYLINDERBAR
CONEBAR

Parameters:
int - chartType - representing the chart type
chartType -
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)

getChartType

public int getChartType()
Return an int corresponding to this ChartHandle's Chart Type for the default chart
To see possible Chart Types, view the public static int's in ChartHandle.

Returns:
int chart type
See Also:
static Chart Type Constants, ChartHandle.setChartType

getChartType

public int getChartType(int nChart)
Return an int corresponding to this ChartHandle's Chart Type for the specified chart
To see possible Chart Types, view the public static int's in ChartHandle.

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
Returns:
int chart type
See Also:
static Chart Type Constants, ChartHandle.setChartType

setLocationLocked

public boolean setLocationLocked(String loc,
                                 boolean l)
Sets the location lock on the Cell Reference at the specified location Used to prevent updating of the Cell Reference when Cells are moved.

Parameters:
location - of the Cell Reference to be locked/unlocked
lock - status setting
Returns:
boolean whether the Cell Reference was found and modified

changeSeriesRange

public boolean changeSeriesRange(String originalrange,
                                 String newrange)
Change the Cell Range referenced by one of the Series (a bar, line or wedge of data) in the Chart.

For Example, if the data values for one of the Series in the Chart are obtained from the range Sheet1!A1:A10 and we want to add 5 more values to that Series, use:
boolean changedOK = charthandle.changeSeriesRange("Sheet1!A1:A10","Sheet1!A1:A15");

Please keep in mind this is only the data range; it does not include labels that may have been automatically created when you chose the chart range.

To illustrate this, if A1 = "label" A2 = "data" A3 = "data", and we want to add 2 more data points, we would use: changeSeriesRange("Sheet1!A2:A3", "Sheet1!A2:A5");

Series are always expressed as one single line of data. If your chart encompasses a range of rows and columns you will need to modify each of the series in the chart handle. To determine the series that already exist in your chart, utilize the String[] getSeries() method.

Parameters:
String - originalrange - the original Series (bar, line or wedge of data) to alter
String - newrange -the new data range
Returns:
whether the change was successful

changeCategoryRange

public boolean changeCategoryRange(String originalrange,
                                   String newrange)
Change the Cell Range representing the Categories in the Chart.
Categories usually appear on the X Axis and are textual, not numeric
For example: the Category values in the Chart are obtained from the range Sheet1!A1:A10 and we want to add 5 more categories to the chart:
boolean changedOK = chart.changeCategoryRange("Sheet1!A1:A10","Sheet1!A1:A15");
Note that Category Range is the same for each Series (bar, line or wedge of data)
i.e. there is only one Category Range for the Chart, but there may be many Series Ranges

Parameters:
String - originalrange - Original Category Range
String - newrange - New Category Range
Returns:
true if the change was successful

setSeries

public ChartSeriesHandle setSeries(int index,
                                   String legendCell,
                                   String categoryRange,
                                   String seriesRange,
                                   String bubbleRange)
                            throws com.extentech.formats.XLS.CellNotFoundException
Changes or adds a Series to the chart via Series Index. Each bar, line or wedge in a chart represents a Series.
If the Series index is greater than the number of series already present in the chart, the series will be added to the end.
Otherwise the Series at the index position will be altered.
This method allows altering of every aspect of the Series: Data (Series) Range, Legend Cell Address, Category Range and/or Bubble Range.

Parameters:
int - index - the series index. If greater than the number of series already present in the chart, the series will be added to the end
String - legendCell - String representation of Legend Cell Address
String - categoryRange - String representation of Category Range (should be same for all series)
String - seriesRange - String representation of the Series Data Range for this series
String - bubbleRange - String representation of Bubble Range (representing bubble sizes), if bubble chart. null if not
Returns:
a ChartSeriesHandle representing the new or altered Series
Throws:
com.extentech.formats.XLS.CellNotFoundException

setSeries

public ChartSeriesHandle setSeries(int index,
                                   String legendCell,
                                   String legendText,
                                   String categoryRange,
                                   String seriesRange,
                                   String bubbleRange)
                            throws com.extentech.formats.XLS.CellNotFoundException
Changes or adds a Series to the chart via Series Index. Each bar, line or wedge in a chart represents a Series.
If the Series index is greater than the number of series already present in the chart, the series will be added to the end.
Otherwise the Series at the index position will be altered.
This method allows altering of every aspect of the Series: Data (Series) Range, Legend Text, Legend Cell Address, Category Range and/or Bubble Range.

Parameters:
int - index - the series index. If greater than the number of series already present in the chart, the series will be added to the end
String - legendCell - String representation of Legend Cell Address
String - legendText - String Legend text
String - categoryRange - String representation of Category Range (should be same for all series)
String - seriesRange - String representation of the Series Data Range for this series
String - bubbleRange - String representation of Bubble Range (representing bubble sizes), if bubble chart. null if not
Returns:
a ChartSeriesHandle representing the new or altered Series
Throws:
com.extentech.formats.XLS.CellNotFoundException

setSeries

public ChartSeriesHandle setSeries(int index,
                                   String legendCell,
                                   String legendText,
                                   String categoryRange,
                                   String seriesRange,
                                   String bubbleRange,
                                   int nChart)
                            throws com.extentech.formats.XLS.CellNotFoundException
Changes or adds a Series to the desired Chart (either default or overlay) via Series Index. Each bar, line or wedge in a chart represents a Series.
If the Series index is greater than the number of series already present in the chart, the series will be added to the end.
Otherwise the Series at the index position will be altered.
This method allows altering of every aspect of the Series: Data (Series) Range, Legend Text, Legend Cell Address, Category Range and/or Bubble Range.

Parameters:
int - index - the series index. If greater than the number of series already present in the chart, the series will be added to the end
String - legendCell - String representation of Legend Cell Address
String - legendText - String Legend text
String - categoryRange - String representation of Category Range (should be same for all series)
String - seriesRange - String representation of the Series Data Range for this series
String - bubbleRange - String representation of Bubble Range (representing bubble sizes), if bubble chart. null if not
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
Returns:
a ChartSeriesHandle representing the new or altered Series
Throws:
com.extentech.formats.XLS.CellNotFoundException

addSeriesRange

public ChartSeriesHandle addSeriesRange(String legendCell,
                                        String categoryRange,
                                        String seriesRange,
                                        String bubbleRange)
                                 throws com.extentech.formats.XLS.CellNotFoundException
Adds a new Series to the chart. Each bar, line or wedge in a chart represents a Series.
An Example of adding multiple series to a chart:

ChartHandle.addSeriesRange("Sheet1!A3", "Sheet1!B1:E1", "Sheet1:B3:E3", null);
ChartHandle.addSeriesRange("Sheet1!A4", "Sheet1!B1:E1", "Sheet1:B4:E4", null);
ChartHandle.addSeriesRange("Sheet1!A5", "Sheet1!B1:E1", "Sheet1:B5:E5", null);
etc...

Note that the category does not change, it is usually constant through series.
Also note that the example above is for a non-bubble-type chart.

Parameters:
String - legendCell - Cell reference for the legend cell (e.g. Sheet1!A1)
String - categoryRange - Category Cell range (e.g. Sheet1!B1:B1);
String - seriesRange - Series Data range (e.g. Sheet1!B3:E3);
String - bubbleRange - Cell Range representing Bubble sizes (e.g. Sheet1!A2:A5); or null if chart is not of type Bubble.
Returns:
ChartSeriesHandle referencing the newly added series
Throws:
com.extentech.formats.XLS.CellNotFoundException

addSeriesRange

public ChartSeriesHandle addSeriesRange(String legendCell,
                                        String categoryRange,
                                        String seriesRange,
                                        String bubbleRange,
                                        int nChart)
                                 throws com.extentech.formats.XLS.CellNotFoundException
Adds a new Series to the chart. Each bar, line or wedge in a chart represents a Series.
An Example of adding multiple series to a chart:

ChartHandle.addSeriesRange("Sheet1!A3", "Sheet1!B1:E1", "Sheet1:B3:E3", null);
ChartHandle.addSeriesRange("Sheet1!A4", "Sheet1!B1:E1", "Sheet1:B4:E4", null);
ChartHandle.addSeriesRange("Sheet1!A5", "Sheet1!B1:E1", "Sheet1:B5:E5", null);
etc...

Note that the category does not change, it is usually constant through series.
Also note that the example above is for a non-bubble-type chart.

Parameters:
String - legendCell - Cell reference for the legend cell (e.g. Sheet1!A1)
String - categoryRange - Category Cell range (e.g. Sheet1!B1:B1);
String - seriesRange - Series Data range (e.g. Sheet1!B3:E3);
String - bubbleRange - Cell Range representing Bubble sizes (e.g. Sheet1!A2:A5); or null if chart is not of type Bubble.
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
Returns:
ChartSeriesHandle referencing the newly added series
Throws:
com.extentech.formats.XLS.CellNotFoundException

addSeriesRange

public ChartSeriesHandle addSeriesRange(CellHandle legendCell,
                                        CellRange categoryRange,
                                        CellRange seriesRange,
                                        CellRange bubbleRange)
Adds a new Series to the chart via CellHandles and CellRange Objects. Each bar, line or wedge in a chart represents a Series.

Parameters:
CellHandle - legendCell - references the legend cell for this series
CellRange - categoryRange - The CellRange referencing the category (should be the same for all Series)
CelLRange - seriesRange - The CellRange referencing the data points for one bar, line or wedge in the chart
CellRange - bubbleRange -The CellRange referencing bubble sizes for this series, or null if chart is not of type BUBBLE
Returns:
ChartSeriesHandle referencing the newly added series
See Also:
ChartHandle.addSeriesRange(String legendCell, String categoryRange, String seriesRange, String bubbleRange)

addSeriesRange

public ChartSeriesHandle addSeriesRange(CellHandle legendCell,
                                        CellRange categoryRange,
                                        CellRange seriesRange,
                                        CellRange bubbleRange,
                                        int nChart)
Adds a new Series to the chart via CellHandles and CellRange Objects. Each bar, line or wedge in a chart represents a Series.
This method can update the default chart (nChart==0) or overlay charts (nChart 1-9)

Parameters:
CellHandle - legendCell - references the legend cell for this series
CellRange - categoryRange - The CellRange referencing the category (should be the same for all Series)
CelLRange - seriesRange - The CellRange referencing the data points for one bar, line or wedge in the chart
CellRange - bubbleRange -The CellRange referencing bubble sizes for this series, or null if chart is not of type BUBBLE
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
Returns:
ChartSeriesHandle referencing the newly added series
See Also:
ChartHandle.addSeriesRange(String legendCell, String categoryRange, String seriesRange, String bubbleRange)

removeSeries

public void removeSeries(int index)
remove the Series (bar, line or wedge) at the desired index

Parameters:
int - index - series index (valid values: 0 to getAllChartSeriesHandles().length-1)
See Also:
getAllChartSeriesHandles

removeSeries

public void removeSeries(int index,
                         int nChart)
remove the Series (bar, line or wedge) at the desired index

Parameters:
int - index - series index (valid values: 0 to getAllChartSeriesHandles().length-1)
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
See Also:
getAllChartSeriesHandles

addAllSeries

public void addAllSeries(String[] valueRanges,
                         String[] legendCells,
                         String[] bubbleSizeRanges,
                         String categoryRange)
updates (replaces) every Chart Series (bar, line or wedge on the Chart) with the data from the array of values, legends, bubble sizes (optional) and category range.
NOTE: all arrays must be the same size (the exception is the bubleSizeRanges array, which may be null)

NOTE: String arrays come in reverse order from plugins, so this method adds series LIFO i.e. reversed

Parameters:
String[] - valueRanges - Array of Cell Ranges representing the Values or Data points for each series (bar, line or wedge) on the Chart
String[] - legendCells - Array of Cell Addresses representing the legends for each Series
String[] - bubbleSizeRanges - Array of Cell ranges representing the bubble sizes for the Chart, or null if chart is not of type BUBBLE
String - categoryRange - The Cell Range representing the categories (X Axis) for the entire Chart

appendRowSeriesToChart

public ChartSeriesHandle appendRowSeriesToChart()
Appends a series one row below the last series in the chart.

This can be utilized when programmatically adding rows of data that should be reflected in the chart.
Legend cell will be incremented by one row if a reference. Category range will stay the same.
In order for this method to work properly the chart must have row-based series. If your chart utilizes column-based series, then you need to append a category.

Returns:
ChartSeriesHandle representing newly added series
See Also:
ChartHandle.appendRowCategoryToChart

appendRowSeriesToChart

public ChartSeriesHandle appendRowSeriesToChart(int nChart)
Appends a series one row below the last series in the chart for the desired chart

This can be utilized when programmatically adding rows of data that should be reflected in the chart.
Legend cell will be incremented by one row if a reference. Category range will stay the same.
In order for this method to work properly the chart must have row-based series. If your chart utilizes column-based series, then you need to append a category.

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
Returns:
ChartSeriesHandle representing newly added series
See Also:
ChartHandle.appendRowCategoryToChart

appendRowCategoryToChart

public void appendRowCategoryToChart()
Append a row of categories to the bottom of the chart.
Expands all Series to include the new bottom row.
To be utilized when expanding a chart to encompass more data that has a col-based series.

See Also:
ChartHandle.appendRowSeriesToChart

appendRowCategoryToChart

public void appendRowCategoryToChart(int nChart)
Append a row of categories to the bottom of the chart.
Expands all Series to include the new bottom row.
To be utilized when expanding a chart to encompass more data that has a col-based series.

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
See Also:
ChartHandle.appendRowSeriesToChart

getChartBytes

public byte[] getChartBytes()
Get the Chart's bytes This is an internal method that is not useful to the end user.


getSerialBytes

public byte[] getSerialBytes()

getXML

public String getXML()
returns an XML representation of this chart

Returns:
String XML

getOOXML

public String getOOXML(int rId)
Generates OOXML (chartML) for this chart object.
NOTE: necessary root chartSpace element + namespaces are not set here

Parameters:
int - rId -reference ID for this chart
Returns:
String representing the OOXML describing this Chart

getChartDrawingOOXML

public String getChartDrawingOOXML(int id)
generates the OOXML specific for DrawingML, specifying offsets and identifying the chart object.
this Drawing ML (OOXML) is distinct from Chart ML (OOXML) which actually defines the chart object including series, categories and axes
This is an internal method that is not useful to the end user.

Parameters:
int - id - the reference id for this chart
Returns:
String OOXML

parseOOXML

public void parseOOXML(InputStream ii)
defines this chart object based on a Chart ML (OOXML) input Stream
This is an internal method that is not useful to the end user.

Parameters:
inputStream - ii - representing chart OOXML

setEditMovement

public void setEditMovement(String editMovement)
Specifies how to resize or move this Chart upon edit
This is an internal method that is not useful to the end user.
Excel 7/OOXML specific

Parameters:
editMovement - String OOXML-specific edit movement setting

getOOXMLName

public String getOOXMLName()
return the Excel 7/OOXML-specific name for this chart

Returns:
String OOXML name

setOOXMLName

public void setOOXMLName(String name)
set the Excel 7/OOXML-specific name for this chart

Parameters:
String - name

getChartEmbeds

public ArrayList getChartEmbeds()
returns the drawingml file name which defines the userShape (if any)
a userShape is a drawing or shape ontop of a chart associated with this chart

Returns:

addChartEmbed

public void addChartEmbed(String[] ce)
sets external information linked to or "embedded" in this OOXML chart; can be a chart user shape, an image ...
NOTE: a userShape is a drawingml file name which defines the userShape (if any)
a userShape is a drawing or shape ontop of a chart

Parameters:
String[] - embedType, filename e.g. {"userShape", "userShape file name"}

setChartOption

public void setChartOption(String op,
                           String val)
Method for setting Chart-Type-specific options in a generic fashion e.g. charthandle.setChartOption("Stacked", "true");

Note: since most Chart Type Options are interdependent, there are several makeXX methods that set the desired group of options e.g. makeStacked(); use setChartOption with care

Note that not all Chart Types will have every option available

Possible Options:

"Stacked" - true or false - set Chart Series to be Stacked
"Cluster" - true or false - set Clustered for Column and Bar Chart Types
"PercentageDisplay" - true or false - Each Category is broken down as a percentge
"Percentage" - Distance of pie slice from center of pie as % for Pie Charts (0 for all others)
"donutSize" - Donut size for Donut Charts Only
"Overlap" - Space between bars (default= 0%)
"Gap" - Space between categories (%) (default=50%)
"SmoothedLine" - true or false - the Line series has a smoothed line
"AnRot" - Rotation Angle (0 to 360 degrees), usually 0 for pie, 20 for others (3D option)
"AnElev" - Elevation Angle (-90 to 90 degrees) (15 is default) (3D option)
"ThreeDScaling" - true or false - 3d effect
"TwoDWalls" - true if 2D walls (3D option)
"PcDist" - Distance from eye to chart (0 to 100) (30 is default) (3D option)
"ThreeDBubbles" - true or false - Draw bubbles with a 3d effect
"ShowLdrLines" - true or false - Show Pie and Donut charts Leader Lines
"MarkerFormat" - "0" thru "9" for various marker options @see ChartHandle.setMarkerFormat
"ShowLabel" - true or false - show Series/Data Label
"ShowCatLabel" - true or false - show Category Label
"ShowLabelPct" - true or false - show percentage labels for Pie charts
"ShowBubbleSizes" - true or false - show bubble sizes for Bubble charts

NOTE: all values must be in String form

See Also:
ChartHandle.getXML

isThreeD

public boolean isThreeD()
Returns:
true if Chart has 3D effects, false otherwise

isStacked

public boolean isStacked()
Returns:
boolean true if Chart contains Stacked Series, false otherwise

is100PercentStacked

public boolean is100PercentStacked()
Returns:
boolean true if Chart is of type 100% Stacked, false otherwise

isClustered

public boolean isClustered()
Returns:
boolean true if Chart contains Clustered Bars or Columns, false otherwise

getThreeDXML

public String getThreeDXML()
Returns:
String ThreeD options in XML form

initThreeD

public com.extentech.formats.XLS.charts.ThreeD initThreeD(int nChart)
Make chart 3D if not already

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)
Returns:
ThreeD rec

getAxisOptions

public String getAxisOptions(int Axis)
Parameters:
int - Axis - one of the Axis constants (Axis.XAXIS, Axis.YAXIS or Axis.ZAXIS)
Returns:
String XML representation of the desired Axis

getAxis

public com.extentech.formats.XLS.charts.Axis getAxis(int axisType)
returns the desired axis (creates if doesn't exist)

Parameters:
int - axisType - one of the Axis constants (Axis.XAXIS, Axis.YAXIS or Axis.ZAXIS)
Returns:
Axis Object

getAxisPlacement

public int getAxisPlacement(int Axis)
Returns the Axis Label Placement or position as an int

One of:
Axis.INVISIBLE - axis is hidden
Axis.LOW - low end of plot area
Axis.HIGH - high end of plot area
Axis.NEXTTO- next to axis (default)

Parameters:
int - Axis - one of the Axis constants (Axis.XAXIS, Axis.YAXIS or Axis.ZAXIS)
Returns:
int - one of the Axis Label placement constants above

setAxisPlacement

public void setAxisPlacement(int Axis,
                             int Placement)
Sets the Axis labels position or placement to the desired value (these match Excel placement options)

Possible options:
Axis.INVISIBLE - hides the axis
Axis.LOW - low end of plot area
Axis.HIGH - high end of plot area
Axis.NEXTTO- next to axis (default)

Parameters:
int - Axis - one of the Axis constants (Axis.XAXIS, Axis.YAXIS or Axis.ZAXIS)
Placement - - int one of the Axis placement constants listed above

removeAxis

public void removeAxis(int axisType)
removes the desired Axis from the Chart

Parameters:
int - axisType - one of the Axis constants (Axis.XAXIS, Axis.YAXIS or Axis.ZAXIS)

getChartFontRecsXML

public String getChartFontRecsXML()
returns Chart-specific Font Records in XML form

Returns:
String Chart Font information in XML format

getChartFontsXML

public String getChartFontsXML()
Return non-axis Chart font ids in XML form

Returns:
String Font information in XML format

setChartFont

public void setChartFont(String type,
                         String val)
Set non-axis chart font id for title, default, etc
For Internal Use Only

Parameters:
String - type - font type
String - val - font id

getWorkBook

public com.extentech.formats.XLS.WorkBook getWorkBook()
Returns:
the WorkBook Object attached to this Chart

setBounds

public void setBounds(short[] bounds)
sets the coordinates or bounds (position, width and height) of this chart in pixels

Parameters:
short[4] - bounds - left or x value, top or y value, width, height
See Also:
ChartHandle.X, ChartHandle.Y, ChartHandle.WIDTH, ChartHandle.HEIGHT

getBounds

public short[] getBounds()
returns the coordinates or bounds (position, width and height) of this chart in pixels

Returns:
short[4] bounds - left or x value, top or y value, width, height
See Also:
ChartHandle.X, ChartHandle.Y, ChartHandle.WIDTH, ChartHandle.HEIGHT

setCoords

public void setCoords(short[] coords)
sets the coordinates (position, width and height) for this chart in pixels

See Also:
ChartHandle.X, ChartHandle.Y, ChartHandle.WIDTH, ChartHandle.HEIGHT

getCoords

public short[] getCoords()
returns the coordinates (position, width and height) of this chart in pixels

Returns:
short[4] coords - left or x value, top or y value, width, height
See Also:
ChartHandle.X, ChartHandle.Y, ChartHandle.WIDTH, ChartHandle.HEIGHT

getRelativeBounds

public short[] getRelativeBounds()
get the bounds of the chart using coordinates relative to row/cols and their offsets

Returns:
short[8] bounds - COL, COLOFFSET, ROW, ROWOFFST, COL1, COLOFFSET1, ROW1, ROWOFFSET1

setRelativeBounds

public void setRelativeBounds(short[] bounds)
sets the bounds of the chart using coordinates relative to row/cols and their offsets

Parameters:
short[8] - bounds - COL, COLOFFSET, ROW, ROWOFFST, COL1, COLOFFSET1, ROW1, ROWOFFSET1

writeChartRecs

public void writeChartRecs(String fName)
For internal debugging use only


setDataLabel

public void setDataLabel(String type,
                         boolean bShowLegendKey)
set DataLabels option for this chart

Parameters:
String - type - see below
boolean - bShowLegendKey - true if show legend key, false otherwise

possible String type values:
Series
Category
Value
Percentage (Only for Pie Charts)
Bubble (Only for Bubble Charts)
X Value (Only for Bubble Charts)
Y Value (Only for Bubble Charts)
CandP

NOTE: not 100% implemented at this time


showDataTable

public void showDataTable(boolean bShow)
shows or removes the Data Table for this chart

Parameters:
boolean - bShow - true if show data table

showLegend

public void showLegend(boolean bShow,
                       boolean vertical)
shows or hides the Chart legend key

Parameters:
booean - bShow - true if show legend, false to hide
boolean - vertical - true if show vertically, false for horizontal

hasDataLegend

public boolean hasDataLegend()
returns true if Chart has a Data Legend Key showing

Returns:
true if Chart has a Data Legend Key showing

makeStacked

public void makeStacked(int nChart)
makes this Chart Stacked
sets the group of options necessary to create a stacked chart
For Chart Types:
BAR, COL, LINE, AREA, PYRAMID, PYRAMIDBAR, CYLINDER, CYLINDERBAR, CONE, CONEBAR

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)

make100PercentStacked

public void make100PercentStacked(int nChart)
makes this Chart 100% Stacked
sets the group of options necessary to create a 100% stacked chart
For Chart Types:
BAR, COL, LINE, PYRAMID, PYRAMIDBAR, CYLINDER, CYLINDERBAR, CONE, CONEBAR

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)

makeStacked3D

public void makeStacked3D(int nChart)
makes this Chart Stacked with a 3D Effect
sets the group of options necessary to create a Stacked 3D chart
For Chart Types:
BAR, COL, AREA

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)

make100PercentStacked3D

public void make100PercentStacked3D(int nChart)
makes this Chart 100% Stacked with a 3D Effect
sets the group of options necessary to create a 100% Stacked 3D chart
For Chart Types:
BAR, COL, AREA

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)

make3D

public void make3D()
makes the default Chart hava a 3D effect
sets the group of options necessary to create a 3D chart
For Chart Types:
BAR, COL, LINE, PIE, AREA, BUBBLE, PYRAMID, CYLINDER, CONE


makeClustered3D

public void makeClustered3D(int nChart)
makes this Chart Clusted with a 3D effect
sets the group of options necessary to create a Clusted 3D chart
For Chart Types:
BAR, COL

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)

makeExploded

public void makeExploded()
makes this chart's wedges exploded i.e. separated
For Chart Types:
PIE, DOUGHNUT


makeExploded3D

public void makeExploded3D(int nChart)
makes this chart's wedges exploded 3D i.e. separated with a 3D effect
For Chart Types:
PIE, DOUGHNUT

Parameters:
nChart - number and drawing order of the desired chart (default= 0 max=9 where 1-9 indicate an overlay chart)

setMarkerFormat

public void setMarkerFormat(int imf)
set the marker format style for this chart
one of:
0 = no marker
1 = square
2 = diamond
3 = triangle
4 = X
5 = star
6 = Dow-Jones
7 = standard deviation
8 = circle
9 = plus sign
For Chart Types:
LINE, SCATTER

Parameters:
int - imf - marker format constant from list above

getJSON

public String getJSON()
returs the JSON representation of this chart, based upon Dojo-charting-specifics

Returns:
String JSON representation of the chart

getSeriesJSON

public org.json.JSONArray getSeriesJSON()
retrieves the saved Series JSON for comparisons
This is an internal method that is not useful to the end user.

Returns:
JSONArray

setSeriesJSON

public void setSeriesJSON(org.json.JSONArray s)
                   throws org.json.JSONException
sets the saved Series JSON
This is an internal method that is not useful to the end user.

Parameters:
JSONArray - s -
Throws:
org.json.JSONException

getCurrentSeries

public org.json.JSONObject getCurrentSeries()
retrieves current series and axis scale info in JSONObject form used upon chart updating
This is an internal method that is not useful to the end user.

Returns:
JSONObject series and axis info

getAllSeriesDataJSON

public String getAllSeriesDataJSON()
returns a JSON representation of all Series Data (Legend, Categogies, Series Values) for the chart
This is an internal method that is not useful to the end user.

Returns:
String JSON representation

getPdfXML

public String getPdfXML()
returns the correct XML for Pdf Input


getSVG

public String getSVG()
TODO: Less Common Charts: STOCK RADAR SURFACE COLUMN- 3D, CONE, CYLINDER, PYRAMID BAR- 3D, CONE, CYLINDER, PYRAMID 3D PIE 3D LINE 3D AREA LINE CHART APPEARS THAT STARTS AND ENDS A BIT TOO EARLY ***************** Z Axis CHART OPTIONS: STACKED CLUSTERED


getSVG

public String getSVG(double scale)
/** Take current Chart object and return the SVG code necessary to define it, scaled to the desired percentage e.g. 0.75= 75%

Parameters:
scale - double scale factor
Returns:
String SVG


Copyright © 2011 Extentech Inc. All Rights Reserved.