public class LogAxis extends Axis
Axis axis = NumericAxis.getCurrencyAxis(Locale.USA); axis = new LogAxis(axis); graph.setAxis(Axis.LEFT, axis);
Modifier and Type | Field and Description |
---|---|
protected Axis |
axis |
BOTTOM, DENSITY_MINIMAL, DENSITY_NORMAL, DENSITY_SPARSE, LEFT, RIGHT, spinestyle, TOP, ZAXIS
Constructor and Description |
---|
LogAxis(Axis axis)
Create a new LogAxis with a base of 10
|
LogAxis(Axis axis,
double base)
Create a new LogAxis with the specified base
|
Modifier and Type | Method and Description |
---|---|
String |
format(double in)
Given the specified number, return the text that should be placed against the
tooth at that position.
|
void |
setLabel(String text,
TextStyle style)
Set a label to be displayed next to the axis.
|
void |
setMaxValue(double val)
Set the maximum value to be plotted on the Axis.
|
void |
setMinValue(double val)
Set the minimum value to be plotted on the Axis.
|
void |
setSpineStyle(Style style)
Set the style used to draw the spine of the axis.
|
void |
setToothLength(double toothlength)
Set the length of the teeth that come off the spine of the axis.
|
void |
setToothTextStyle(TextStyle style)
Set the style used to draw the labels on the teeth.
|
void |
setWallPaint(Paint paint)
Set the paint to be used on the wall next to this axis.
|
void |
setZeroIntersection(boolean zero)
Whether this axis should cross it's adjacent axis where that axis is zero.
|
double[] |
steps(double min,
double max)
The
steps method controls where the teeth are placed on the spine. |
setWallPaint, setWallPaint, toString
protected Axis axis
public LogAxis(Axis axis)
axis
- the axis to wrappublic LogAxis(Axis axis, double base)
axis
- the axis to wrapbase
- the base to use - must be > 0 but not 1public void setZeroIntersection(boolean zero)
Axis
setZeroIntersection
in class Axis
zero
- whether to cross the adjacent axis at zero. The default is falsepublic void setToothLength(double toothlength)
Axis
setToothLength
in class Axis
toothlength
- the length of the teeth as a proportion of the width of the graph. The default is 0.01public void setSpineStyle(Style style)
Axis
setSpineStyle
in class Axis
style
- the style to draw the spine and teeth in - the default is a solid black line.public void setToothTextStyle(TextStyle style)
Axis
setPadding...
methods can be used to increase the space between the teeth and their text,
and the TextStyle.setAlign(int)
method used to control the position of the
text relative to the teeth.setToothTextStyle
in class Axis
style
- the style to display the teeth labels in.public void setWallPaint(Paint paint)
Axis
X-Rotation
or Y-Rotation
these walls would be invisible.setWallPaint
in class Axis
paint
- the Paint to use on the wall running into the graph from
this axis, or null
to not paint the wallAxesGraph.setBackWallPaint(Paint)
public void setLabel(String text, TextStyle style)
Axis
TextStyle.setPaddingBottom(double)
and TextStyle.setPaddingTop(double)
settings
of the style to control the distance between the label and the axis.public final double[] steps(double min, double max)
Axis
The steps
method controls where the teeth are placed on the spine.
Each subclass of Axis has a different strategy - for instance, the
DateAxis
will try and place ticks on the 1st of the month, the
NumericAxis
will try and place them evenly across the range and so on.
The returned array should consist of a range of numbers, ordered from low to high,
which mark the locations of the teeth on the spine. min
and max
are the minimum and maximum values of the data to plot, and these values will usually
be the first and last values in the returned array.
Those wanting to create their own custom axis will typically override this method and
Axis.format(double)
.
public String format(double in)
Axis
Given the specified number, return the text that should be placed against the
tooth at that position. For example, an Axis that simply plotted integer
values might return Integer.toString((int)in)
Those wanting to create their own custom axis will typically override this
method and Axis.steps(double, double)
.
public void setMaxValue(double val)
Axis
setMaxValue
in class Axis
val
- the maximum value to plot on this axispublic void setMinValue(double val)
Axis
Axis.setMaxValue(double)
this value will be expanded if required to fit the values
from the various series.setMinValue
in class Axis
val
- the minimum value to plot on this axisCopyright © 2001-2016 Big Faceless Organization