org.jfree.chart.axis
public class LogAxis extends ValueAxis
Since: 1.0.7
Constructor Summary | |
---|---|
LogAxis()
Creates a new LogAxis with no label. | |
LogAxis(String label)
Creates a new LogAxis with the given label.
|
Method Summary | |
---|---|
protected void | autoAdjustRange()
Adjusts the axis range to match the data range that the axis is
required to display. |
double | calculateLog(double value)
Calculates the log of the given value, using the current base.
|
double | calculateValue(double log)
Calculates the value from a given log.
|
void | configure()
Configures the axis. |
static TickUnitSource | createLogTickUnits(Locale locale)
Returns a collection of tick units for log (base 10) values.
|
protected String | createTickLabel(double value)
Creates a tick label for the specified value. |
AxisState | draw(Graphics2D g2, double cursor, Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, PlotRenderingInfo plotState)
Draws the axis on a Java 2D graphics device (such as the screen or a
printer).
|
boolean | equals(Object obj)
Tests this axis for equality with an arbitrary object.
|
protected double | estimateMaximumTickLabelHeight(Graphics2D g2)
Estimates the maximum tick label height.
|
protected double | estimateMaximumTickLabelWidth(Graphics2D g2, TickUnit unit)
Estimates the maximum width of the tick labels, assuming the specified
tick unit is used.
|
double | exponentLengthToJava2D(double length, Rectangle2D area, RectangleEdge edge)
Converts a length in data coordinates into the corresponding length in
Java2D coordinates.
|
double | getBase()
Returns the base for the logarithm calculation.
|
NumberFormat | getNumberFormatOverride()
Returns the number format override. |
double | getSmallestValue()
Returns the smallest value represented by the axis.
|
NumberTickUnit | getTickUnit()
Returns the current tick unit.
|
int | hashCode()
Returns a hash code for this instance.
|
double | java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge)
Converts a Java2D coordinate to an axis value, assuming that the
axis covers the specified edge of the area .
|
void | pan(double percent)
Slides the axis range by the specified percentage.
|
List | refreshTicks(Graphics2D g2, AxisState state, Rectangle2D dataArea, RectangleEdge edge)
Calculates the positions of the tick labels for the axis, storing the
results in the tick label list (ready for drawing).
|
protected List | refreshTicksHorizontal(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
Returns a list of ticks for an axis at the top or bottom of the chart.
|
protected List | refreshTicksVertical(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
Returns a list of ticks for an axis at the left or right of the chart.
|
protected void | selectAutoTickUnit(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
Selects an appropriate tick value for the axis. |
protected void | selectHorizontalAutoTickUnit(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
Selects an appropriate tick value for the axis. |
protected void | selectVerticalAutoTickUnit(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
Selects an appropriate tick value for the axis. |
void | setBase(double base)
Sets the base for the logarithm calculation and sends an
AxisChangeEvent to all registered listeners.
|
void | setNumberFormatOverride(NumberFormat formatter)
Sets the number format override. |
void | setSmallestValue(double value)
Sets the smallest value represented by the axis and sends an
AxisChangeEvent to all registered listeners.
|
void | setTickUnit(NumberTickUnit unit)
Sets the tick unit for the axis and sends an AxisChangeEvent to
all registered listeners. |
void | setTickUnit(NumberTickUnit unit, boolean notify, boolean turnOffAutoSelect)
Sets the tick unit for the axis and, if requested, sends an
AxisChangeEvent to all registered listeners. |
double | valueToJava2D(double value, Rectangle2D area, RectangleEdge edge)
Converts a value on the axis scale to a Java2D coordinate relative to
the given area , based on the axis running along the
specified edge .
|
void | zoomRange(double lowerPercent, double upperPercent)
Zooms in on the current range.
|
LogAxis
with no label.LogAxis
with the given label.
Parameters: label the axis label (null
permitted).
Parameters: value the value.
Returns: The log of the given value.
Parameters: log the log value (must be > 0.0).
Returns: The value with the given log.
Parameters: locale the locale to use to represent Numbers.
Returns: A collection of tick units for integer values.
Since: 1.0.7
Parameters: value the value.
Returns: The label.
Since: 1.0.10
Parameters: g2 the graphics device (null
not permitted). cursor the cursor location (determines where to draw the axis). plotArea the area within which the axes and plot should be drawn. dataArea the area within which the data should be drawn. edge the axis location (null
not permitted). plotState collects information about the plot
(null
permitted).
Returns: The axis state (never null
).
Parameters: obj the object (null
permitted).
Returns: A boolean.
Parameters: g2 the graphics device.
Returns: The maximum height.
Since: 1.0.7
Rather than computing the string bounds of every tick on the axis, we just look at two values: the lower bound and the upper bound for the axis. These two values will usually be representative.
Parameters: g2 the graphics device. unit the tick unit to use for calculation.
Returns: The estimated maximum width of the tick labels.
Since: 1.0.7
Parameters: length the length. area the plot area. edge the edge along which the axis lies.
Returns: The length in Java2D coordinates.
Since: 1.0.7
Returns: The base for the logarithm calculation.
See Also: LogAxis
Returns: The number formatter (possibly null
).
See Also: setNumberFormatOverride
Returns: The smallest value represented by the axis.
See Also: LogAxis
Returns: The current tick unit.
See Also: setTickUnit
Returns: A hash code.
edge
of the area
.
Parameters: java2DValue the Java2D coordinate. area the area. edge the edge that the axis belongs to.
Returns: A value along the axis scale.
Parameters: percent the percentage.
Since: 1.0.13
Parameters: g2 the graphics device. state the axis state. dataArea the area in which the plot should be drawn. edge the location of the axis.
Returns: A list of ticks.
Parameters: g2 the graphics device. dataArea the data area. edge the edge.
Returns: A list of ticks.
Parameters: g2 the graphics device. dataArea the data area. edge the edge.
Returns: A list of ticks.
Parameters: g2 the graphics device. dataArea the area defined by the axes. edge the axis location.
Since: 1.0.7
Parameters: g2 the graphics device. dataArea the area defined by the axes. edge the axis location.
Since: 1.0.7
Parameters: g2 the graphics device. dataArea the area in which the plot should be drawn. edge the axis location.
Since: 1.0.7
Parameters: base the base value (must be > 1.0).
See Also: getBase
Parameters: formatter the number formatter (null
permitted).
See Also: getNumberFormatOverride
Parameters: value the value.
See Also: getSmallestValue
Parameters: unit the new tick unit (null
not permitted).
See Also: getTickUnit
Parameters: unit the new tick unit (null
not permitted). notify notify listeners? turnOffAutoSelect turn off the auto-tick selection?
See Also: getTickUnit
area
, based on the axis running along the
specified edge
.
Parameters: value the data value. area the area. edge the edge.
Returns: The Java2D coordinate corresponding to value
.
Parameters: lowerPercent the new lower bound. upperPercent the new upper bound.