|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faceless.graph2.Axis
org.faceless.graph2.GapAxis
public class GapAxis
A type of Axis that can be used to put a "gap" in the middle of an
axis. Like the LogAxis, this class works as a "wrapper" around
a simple axis. So, for example, to plot the integer values from 0 to 20
and then skip the values from 20 to 1000, do:
Axis axis = NumericAxis.getIntegerAxis(); axis = new GapAxis(axis, 20, 1000); graph.setAxis(Axis.LEFT, axis);
| Field Summary |
|---|
| Fields inherited from class org.faceless.graph2.Axis |
|---|
BOTTOM, DENSITY_MINIMAL, DENSITY_NORMAL, DENSITY_SPARSE, LEFT, RIGHT, TOP, ZAXIS |
| Constructor Summary | |
|---|---|
GapAxis(Axis axis,
double gapstart,
double gapend)
Create a new GapAxis which will skip values between the supplied parameters |
|
| Method Summary | |
|---|---|
String |
format(double in)
Given the specified number, return the text that should be placed against the tooth at that position. |
void |
setDividerSize(int size)
Set the size of the "squiggle" drawn at the point where the gap is. |
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. |
| Methods inherited from class org.faceless.graph2.Axis |
|---|
setWallPaint, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GapAxis(Axis axis,
double gapstart,
double gapend)
axis - the axis to wrap| Method Detail |
|---|
public void setDividerSize(int size)
size - the size of the marker drawn where the gap is, in pixels, points or whatever the
native unit of your Output class ispublic void setZeroIntersection(boolean zero)
Axis
setZeroIntersection in class Axiszero - whether to cross the adjacent axis at zero. The default is falsepublic void setToothLength(double toothlength)
Axis
setToothLength in class Axistoothlength - 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 Axisstyle - the style to draw the spine and teeth in - the default is a solid black line.public void setToothTextStyle(TextStyle style)
AxissetPadding...
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 Axisstyle - the style to display the teeth labels in.public void setWallPaint(Paint paint)
AxisX-Rotation or Y-Rotation
these walls would be invisible.
setWallPaint in class Axispaint - 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)
AxisTextStyle.setPaddingBottom(double) and TextStyle.setPaddingTop(double) settings
of the style to control the distance between the label and the axis.
setLabel in class Axistext - the text to displaystyle - the style to draw the text in
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).
steps in class Axismin - the minimum value of the data to plotmax - the maximum value of the data to plot
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).
format in class Axisin - the value to format
public void setMaxValue(double val)
Axis
setMaxValue in class Axisval - the maximum value to plot on this axispublic void setMinValue(double val)
AxisAxis.setMaxValue(double) this value will be expanded if required to fit the values
from the various series.
setMinValue in class Axisval - the minimum value to plot on this axis
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||