public class ChartAxes extends Object implements ChartConstants, Serializable
AREACHART, BARCHART, BUBBLECHART, COLCHART, CONEBARCHART, CONECHART, CYLINDERBARCHART, CYLINDERCHART, DOUGHNUTCHART, LINECHART, OFPIECHART, PIECHART, PYRAMIDBARCHART, PYRAMIDCHART, RADARAREACHART, RADARCHART, SCATTERCHART, SHAPECOLUMN, SHAPECONE, SHAPECONETOMAX, SHAPECYLINDER, SHAPEDEFAULT, SHAPEPYRAMID, SHAPEPYRAMIDTOMAX, STOCKCHART, SURFACECHART, XAXIS, XVALAXIS, YAXIS, ZAXIS| Constructor and Description |
|---|
ChartAxes(AxisParent ap) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Axis a)
store each axis
|
void |
close() |
void |
createAxis(int axisType) |
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
|
int |
getAxisMajorUnit(int axisType)
Returns the major tick unit of the desired Value axis
|
int |
getAxisMinorUnit(int axisType)
Returns the minor tick unit of the desired Value axis
|
String |
getAxisOptionsXML(int axisType)
obtain the desired axis' label and other options, if present, in XML form
|
int |
getAxisPlacement(int axisType)
returns the Axis Label Placement or position as an int
|
float[] |
getCoords(int axisType)
return the coordinates, in pixels, of the title text area, if possible
|
org.json.JSONObject |
getJSON(int axisType,
WorkBookHandle wbh,
int chartType,
double yMax,
double yMin,
int nSeries) |
Font |
getLabelFont(int axisType)
returns the label font for the desired axis.
|
int |
getLabelRotation(int axisType)
return the rotation of the axis labels, if any
0 to 90 Text rotated 0 to 90 degrees counter-clockwise
91 to 180 Text rotated 1 to 90 degrees clockwise (angle is trot – 90)
255 Text top-to-bottom with letters upright
|
Object |
getMetric(String metric)
returns a specific axis Metric
Use only after calling chart.getMetrics |
HashMap |
getMetrics()
returns already-set axisMetrics
Used only after calling chart.getMetrics |
HashMap<String,Object> |
getMetrics(int charttype,
HashMap<String,Double> chartMetrics,
float[] plotcoords,
Object[] categories)
generate Axis Metrics -- minor, major scale, title and label offsets, etc.
|
double[] |
getMinMax(double ymin,
double ymax)
Returns the YAXIS scale elements (min value, max value, minor (tick) scale, major (tick) scale)
the scale elements are calculated from the minimum and maximum values on the chart
|
double[] |
getMinMax(double ymin,
double ymax,
int axisType)
Returns the scale values of the the desired Value axis
Scale elements: (min value, max value, minor (tick) scale, major (tick) scale) |
protected String |
getNumberFormat(int axisType)
returns the number format for the desired axis
|
String |
getOOXML(int axisType,
int type,
String id,
String crossId)
returns the OOXML necessary to define the desired axis
|
String |
getPlotAreaBgColor()
returns the axis area background color hex string, or null if not set
|
float[] |
getPlotAreaCoords(float w,
float h)
return the coordinates of the outer plot area (plot + axes + labels) in pixels
|
String |
getSVG(int axisType,
Map<String,Double> chartMetrics,
Object[] categories)
returns the SVG necesssary to define the desired axis
|
String |
getTitle(int axisType)
Return the Axis Title, or "" if none
|
Font |
getTitleFont(int axisType)
returns the font for the title for the desired axis
|
int |
getTitleRotation(int axisType)
return the rotation of the axis Title, if any
0 to 90 Text rotated 0 to 90 degrees counter-clockwise
91 to 180 Text rotated 1 to 90 degrees clockwise (angle is trot – 90)
255 Text top-to-bottom with letters upright
|
boolean |
hasAxis(int axisType)
returns true if axisType is found on chart
|
protected boolean |
isReversed(int axisType)
returns true if Axis is reversed
|
void |
parseOOXML(int axisType,
org.xmlpull.v1.XmlPullParser xpp,
String tnm,
Stack<String> lastTag,
WorkBookHandle bk)
parse OOXML axis element
|
void |
removeAxes()
remove ALL axes from this chart
|
void |
removeAxis(int axisType)
remove the desired axis + associated records
|
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 |
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 axisType,
int placement)
sets the axis labels position or placement to the desired value (these match Excel placement options)
|
void |
setChartOption(int axisType,
String op,
String val)
sets an option for this axis
|
void |
setPlotAreaBgColor(int bg)
sets the plot area background color
|
void |
setPlotAreaBorder(int lw,
int lclr)
adds a border around the plot area with the desired line width and line color
|
void |
setTd(int axisType,
TextDisp td) |
void |
setTitle(int axisType,
String Title)
set the axis title string
|
void |
setTitleFont(int axisType,
int fondId)
set the font index for this Axis (for title)
|
public ChartAxes(AxisParent ap)
ap - public void add(Axis a)
a - public void setTd(int axisType,
TextDisp td)
public boolean hasAxis(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISpublic void createAxis(int axisType)
protected boolean isReversed(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISprotected String getNumberFormat(int axisType)
axisType - public void removeAxes()
public void removeAxis(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISpublic float[] getPlotAreaCoords(float w,
float h)
public String getPlotAreaBgColor()
public void setPlotAreaBgColor(int bg)
bg - color intpublic void setPlotAreaBorder(int lw,
int lclr)
lw - lclr - public String getAxisOptionsXML(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISObjectLinkpublic String getTitle(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISpublic void setTitle(int axisType,
String Title)
axisType - one of: XAXIS, YAXIS, ZAXISTitle - public int getLabelRotation(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISpublic int getTitleRotation(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISpublic float[] getCoords(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISpublic double[] getMinMax(double ymin,
double ymax)
ymin - the minimum value of all the series valuesymax - the maximum value of all the series valuespublic double[] getMinMax(double ymin,
double ymax,
int axisType)
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
int - axisType - one of ChartHandle.YAXIS, ChartHandle.XAXIS, ChartHandle.ZAXISgetAxisMinScale()public int getAxisMajorUnit(int axisType)
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
axisType - one of: XAXIS, YAXIS, ZAXISgetAxisMajorUnit()public int getAxisMinorUnit(int axisType)
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
axisType - one of: XAXIS, YAXIS, ZAXISgetAxisMinorUnit()public void setAxisMax(int axisType,
int MaxValue)
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
axisType - one of: XAXIS, YAXIS, ZAXISint - MaxValue - desired maximum value of the desired axissetAxisMax(int MaxValue)public void setAxisMin(int axisType,
int MinValue)
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
axisType - one of: XAXIS, YAXIS, ZAXISint - MinValue - the desired Minimum scale valuesetAxisMin(int MinValue)public void setAxisAutomaticScale(int axisType,
boolean b)
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
axisType - one of: XAXIS, YAXIS, ZAXISboolean - b - true if set Automatic scaling on, false otherwisesetAxisAutomaticScale(boolean b)public boolean getAxisAutomaticScale(int axisType)
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
axisType - one of: XAXIS, YAXIS, ZAXISgetAxisAutomaticScale()public boolean getAxisAutomaticScale()
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
getAxisAutomaticScale(int axisType)public void setAxisAutomaticScale(boolean b)
Automatic Scaling will automatically set the scale maximum, minimum and tick units upon data changes, and is the default chart setting
b - setAxisAutomaticScale(int axisType boolean b)public void setAxisMax(int MaxValue)
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
int - MaxValue - the desired maximum scale valueChartHandle.setAxisMax(int axisType, int MaxValue)public void setAxisMin(int MinValue)
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
int - MinValue - the desired minimum scale valueChartHandle.setAxisMin(int axisType, int MinValue)public String getSVG(int axisType, Map<String,Double> chartMetrics, Object[] categories)
axisType - one of: XAXIS, YAXIS, ZAXISchartMetrics - maps chart coords in pixels x, y, w, h, canvasw, canvash, min, maxpublic String getOOXML(int axisType, int type, String id, String crossId)
axisType - one of: XAXIS, YAXIS, ZAXIStype - id - crossId - public void setTitleFont(int axisType,
int fondId)
axisType - one of: XAXIS, YAXIS, ZAXISfondId - public Font getTitleFont(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISpublic Font getLabelFont(int axisType)
axisType - one of: XAXIS, YAXIS, ZAXISpublic org.json.JSONObject getJSON(int axisType,
WorkBookHandle wbh,
int chartType,
double yMax,
double yMin,
int nSeries)
public void setChartOption(int axisType,
String op,
String val)
axisType - one of: XAXIS, YAXIS, ZAXISop - option name; one of: CatCross, LabelCross, Marks, CrossBetween, CrossMax,
MajorGridLines, AddArea, AreaFg, AreaBg
or Linked Text Display options:
Label, ShowKey, ShowValue, ShowLabelPct, ShowPct,
ShowCatLabel, ShowBubbleSizes, TextRotation, Fontval - option valuepublic int getAxisPlacement(int axisType)
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)
axisType - one of: XAXIS, YAXIS, ZAXISpublic void setAxisPlacement(int axisType,
int placement)
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)
axisType - one of: XAXIS, YAXIS, ZAXISPlacement - - int one of the Axis placement constants listed abovepublic void parseOOXML(int axisType,
org.xmlpull.v1.XmlPullParser xpp,
String tnm,
Stack<String> lastTag,
WorkBookHandle bk)
axisType - one of: XAXIS, YAXIS, ZAXISxpp - XmlPullParser positioned at correct elemntaxisTag - catAx, valAx, serAx, dateAxlastTag - Stack of element namespublic void close()
public HashMap getMetrics()
public Object getMetric(String metric)
metric - String metric option one of
public HashMap<String,Object> getMetrics(int charttype, HashMap<String,Double> chartMetrics, float[] plotcoords, Object[] categories)
charttype - chart type constantchartMetrics - maps chart coords in pixels x, y, w, h, canvasw, canvash, min, maxplotcoords - == if set, plot-area coordinates (may not be set if automatic)Copyright © 2002–2019 Starter Inc.. All rights reserved.