|
Chart Builder API (beta) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ord.media.chart.types.AxisDesc | +--oracle.ord.media.chart.types.NumAxisDesc
NumAxisDesc
objects are used to customize numerical axes,
and are normally supplied as arguments to setChartAttributes()
.
Users have control of axis labeling fonts, extents, spacing attributes,
labeling special characters, and the axis labeling location.
By default, extents (the minimum and maximum values for the numerical axis)
are defined automatically. The user can override the extents
with setExtent(), setExtentMin(),
and setExtentMax()
.
Axis labels may be placed on the left, right, or both axes.
The left axis is the default. This can be changed with
setLabelLocation()
, using
LABEL_RIGHT
to label the right axis,
or LABEL_BOTH
to label both axes.
Note that dual axes can be customized using two separate calls to
setChartAttributes()
, one that includes a NumAxisDesc
with setSecondAxis()
set to false, and the other with
setSecondAxis()
set to true.
By default, the spacing between numerical axis labels is generated automatically,
based on the desired number of labels (getNumLabels()
).
The user can change the desired number of labels to be generated
by invoking setNumLabels()
. Alternatively, a fixed spacing between
Y-axis labels can be specified with setLabelIncrement()
.
Y-axis labels can be left- or right-justified. By default, they are right-justified.
Note that the current release only supports numerical Y-axes.
Consider the following example, which sets the prefix of Y-axis labels to a dollar sign ($):
AxisChart myChart = new AxisChart(); ... NumAxisDesc myNumAxisDesc = new NumAxisDesc(); myNumAxisDesc.setPrefix("$"); myChart.setChartAttributes(myNumAxisDesc);
Note that when using stacked charts, it is possible to define each numerical Y-axis independently. This is accomplished by using the two parameter overloading
of setChartAttributes()
, where the first parameter names the
subchart.
AxisChart.setChartAttributes(NumAxisDesc)
,
AxisChart.setChartAttributes(String, NumAxisDesc)
,
AxisChart.setSubChart(String)
,
AxisDesc
Field Summary | |
static int |
LABEL_BOTH
Identifier for positioning the axis labels on both the left and the right. |
static int |
LABEL_LEFT
Identifier for positioning the axis labels on the left. |
static int |
LABEL_RIGHT
Identifier for positioning the axis labels on the right. |
static int |
LEFT_JUSTIFY
Identifier for specifying that the axis labels be left-justified. |
static int |
RIGHT_JUSTIFY
Identifier for specifying that the axis labels be right-justified. |
Constructor Summary | |
NumAxisDesc()
|
Method Summary | |
boolean |
getAutoExtentMax()
Return true if the maximum extent is Automatic. |
boolean |
getAutoExtentMin()
Return true if the minimum extent is Automatic. |
boolean |
getAutoSpacing()
Get the flag corresponding to automatic spacing. |
double |
getExtentMax()
Get the maximum extent. |
double |
getExtentMin()
Get the minimum extent. |
double |
getLabelIncrement()
Get the increment between labels. |
int |
getLabelJustify()
Get the label justification. |
int |
getLabelLocation()
Get the location of the label. |
java.text.NumberFormat |
getNumberFormat()
Get the NumberFormat string for the Y-axis labels. |
int |
getNumLabels()
Get the number of labels to be written. |
java.lang.String |
getPrefix()
Get the prefix associated with the Y-axis label. |
boolean |
getSecondAxis()
Get the secondAxis flag. |
java.lang.String |
getSuffix()
Get the suffix associated with the Y-axis label. |
void |
setExtent(double ymin,
double ymax)
Set the axis extents. |
void |
setExtentMax(double ymax)
Set the maximum axis extent. |
void |
setExtentMin(double ymin)
Set the minimum axis extent. |
void |
setLabelIncrement(double increment)
Set the increment between labels. |
void |
setLabelJustify(int justify)
Set the justification of the axis labels. |
void |
setLabelLocation(int labelLocation)
Set the axis label location. |
void |
setNumberFormat(java.text.NumberFormat numFormat)
Set the NumberFormat string for the Y-axis labels. |
void |
setNumLabels(int numLabels)
Set the number of labels to be written. |
void |
setPrefix(java.lang.String prefix)
Set the prefix of the Y-axis label. |
void |
setSecondAxis()
Assert that this descriptor applies to the second axis. |
void |
setSuffix(java.lang.String suffix)
Set the suffix of the Y-axis labels. |
Methods inherited from class oracle.ord.media.chart.types.AxisDesc |
getColor, getDrawLabel, getFont, setColor, setDrawLabelOff, setFont |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LABEL_LEFT
LABEL_LEFT
).public static final int LABEL_RIGHT
public static final int LABEL_BOTH
public static final int LEFT_JUSTIFY
public static final int RIGHT_JUSTIFY
RIGHT_JUSTIFY
.Constructor Detail |
public NumAxisDesc()
Method Detail |
public boolean getAutoSpacing()
public void setLabelIncrement(double increment)
increment
- Labels will be written at increment
increments.public void setLabelJustify(int justify) throws ChartException
justify
- Justification of axis labels. Valid arguments are LEFT_JUSTIFY
and
RIGHT_JUSTIFY
.public int getLabelJustify()
public double getLabelIncrement()
public void setNumLabels(int numLabels)
numLabels
- The number of labels to be written.public int getNumLabels()
public void setSecondAxis()
LABEL_RIGHT
.
The setChartAttributes()
call
queries this flag to determine to which axis
the NumAxisDesc
applies.public void setLabelLocation(int labelLocation)
labelLocation
- Valid values are
LABEL_LEFT
, LABEL_RIGHT
, or LABEL_BOTH
.public void setExtent(double ymin, double ymax)
ymin
- Minimum Y-axis value.ymax
- Maximum Y-axis value.public void setExtentMin(double ymin)
ymin
- Minimum Y-axis value.public void setExtentMax(double ymax)
ymax
- Maximum Y-axis value.public void setPrefix(java.lang.String prefix)
prefix
- Prefix associated with the top
numerical value.public void setNumberFormat(java.text.NumberFormat numFormat)
For example, the following code causes the Y-axis to be labeled with numerical values delimited with grouping symbols:
NumberFormat nf = NumberFormat.getInstance(); nf.setGroupingUsed(); myChart.setNumberFormat(nf);
numFormat
- The number format.public java.text.NumberFormat getNumberFormat()
public void setSuffix(java.lang.String suffix)
suffix
- Suffix associated with the top
numerical value.public int getLabelLocation()
public boolean getAutoExtentMin()
public boolean getAutoExtentMax()
public boolean getSecondAxis()
public double getExtentMin()
public double getExtentMax()
public java.lang.String getSuffix()
public java.lang.String getPrefix()
|
Chart Builder API (beta) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |