Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.chart.axis.Axis
org.jfree.chart.axis.ValueAxis
org.jfree.chart.axis.LogAxis
LogarithmicAxis
class.
Field Summary |
Fields inherited from class org.jfree.chart.axis.ValueAxis | |
DEFAULT_AUTO_RANGE , DEFAULT_AUTO_RANGE_MINIMUM_SIZE , DEFAULT_AUTO_TICK_UNIT_SELECTION , DEFAULT_INVERTED , DEFAULT_LOWER_BOUND , DEFAULT_LOWER_MARGIN , DEFAULT_RANGE , DEFAULT_UPPER_BOUND , DEFAULT_UPPER_MARGIN , MAXIMUM_TICK_COUNT |
Constructor Summary | |
| |
|
Method Summary | |
protected void |
|
double |
|
double |
|
void |
|
static TickUnitSource |
|
AxisState |
|
boolean |
|
protected double |
|
protected double |
|
double |
|
double |
|
int |
|
NumberFormat |
|
double |
|
NumberTickUnit |
|
int |
|
double |
|
List |
|
protected List |
|
protected List |
|
protected void |
|
protected void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
double |
|
void |
|
public LogAxis(String label)
Creates a newLogAxis
with the given label.
- Parameters:
label
- the axis label (null
permitted).
protected void autoAdjustRange()
Adjusts the axis range to match the data range that the axis is required to display.
- Overrides:
- autoAdjustRange in interface ValueAxis
public double calculateLog(double value)
Calculates the log of the given value, using the current base.
- Parameters:
value
- the value.
- Returns:
- The log of the given value.
- See Also:
calculateValue(double)
,getBase()
public double calculateValue(double log)
Calculates the value from a given log.
- Parameters:
log
- the log value (must be > 0.0).
- Returns:
- The value with the given log.
- See Also:
calculateLog(double)
,getBase()
public void configure()
Configures the axis. This method is typically called when an axis is assigned to a new plot.
public static TickUnitSource createLogTickUnits(Locale locale)
Returns a collection of tick units for log (base 10) values. Uses a given Locale to create the DecimalFormats.
- Parameters:
locale
- the locale to use to represent Numbers.
- Returns:
- A collection of tick units for integer values.
- Since:
- 1.0.7
public 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).
- 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
).
public boolean equals(Object obj)
Tests this axis for equality with an arbitrary object.
- Parameters:
obj
- the object (null
permitted).
- Returns:
- A boolean.
protected double estimateMaximumTickLabelHeight(Graphics2D g2)
Estimates the maximum tick label height.
- Parameters:
g2
- the graphics device.
- Returns:
- The maximum height.
- Since:
- 1.0.7
protected double estimateMaximumTickLabelWidth(Graphics2D g2, TickUnit unit)
Estimates the maximum width of the tick labels, assuming the specified tick unit is used. 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
public double exponentLengthToJava2D(double length, Rectangle2D area, RectangleEdge edge)
Converts a length in data coordinates into the corresponding length in Java2D coordinates.
- 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
public double getBase()
Returns the base for the logarithm calculation.
- Returns:
- The base for the logarithm calculation.
- See Also:
setBase(double)
public int getMinorTickCount()
Returns the number of minor tick marks to display.
- Returns:
- The number of minor tick marks to display.
- See Also:
setMinorTickCount(int)
public NumberFormat getNumberFormatOverride()
Returns the number format override. If this is non-null, then it will be used to format the numbers on the axis.
- Returns:
- The number formatter (possibly
null
).
public double getSmallestValue()
Returns the smallest value represented by the axis.
- Returns:
- The smallest value represented by the axis.
- See Also:
setSmallestValue(double)
public NumberTickUnit getTickUnit()
Returns the current tick unit.
- Returns:
- The current tick unit.
- See Also:
setTickUnit(NumberTickUnit)
public double java2DToValue(double java2DValue, Rectangle2D area, RectangleEdge edge)
Converts a Java2D coordinate to an axis value, assuming that the axis covers the specifiededge
of thearea
.
- Overrides:
- java2DToValue in interface ValueAxis
- Parameters:
java2DValue
- the Java2D coordinate.area
- the area.edge
- the edge that the axis belongs to.
- Returns:
- A value along the axis scale.
public 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).
- Overrides:
- refreshTicks in interface Axis
- 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.
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.
- Parameters:
g2
- the graphics device.dataArea
- the data area.edge
- the edge.
- Returns:
- A list of ticks.
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.
- Parameters:
g2
- the graphics device.dataArea
- the data area.edge
- the edge.
- Returns:
- A list of ticks.
protected void selectAutoTickUnit(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
Selects an appropriate tick value for the axis. The strategy is to display as many ticks as possible (selected from an array of 'standard' tick units) without the labels overlapping.
- Parameters:
g2
- the graphics device.dataArea
- the area defined by the axes.edge
- the axis location.
- Since:
- 1.0.7
protected void selectHorizontalAutoTickUnit(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
Selects an appropriate tick value for the axis. The strategy is to display as many ticks as possible (selected from an array of 'standard' tick units) without the labels overlapping.
- Parameters:
g2
- the graphics device.dataArea
- the area defined by the axes.edge
- the axis location.
- Since:
- 1.0.7
protected void selectVerticalAutoTickUnit(Graphics2D g2, Rectangle2D dataArea, RectangleEdge edge)
Selects an appropriate tick value for the axis. The strategy is to display as many ticks as possible (selected from an array of 'standard' tick units) without the labels overlapping.
- Parameters:
g2
- the graphics device.dataArea
- the area in which the plot should be drawn.edge
- the axis location.
- Since:
- 1.0.7
public void setBase(double base)
Sets the base for the logarithm calculation and sends anAxisChangeEvent
to all registered listeners.
- Parameters:
base
- the base value (must be > 1.0).
- See Also:
getBase()
public void setMinorTickCount(int count)
Sets the number of minor tick marks to display, and sends anAxisChangeEvent
to all registered listeners.
- Parameters:
count
- the count.
- See Also:
getMinorTickCount()
public void setNumberFormatOverride(NumberFormat formatter)
Sets the number format override. If this is non-null, then it will be used to format the numbers on the axis.
- Parameters:
formatter
- the number formatter (null
permitted).
- See Also:
getNumberFormatOverride()
public void setSmallestValue(double value)
Sets the smallest value represented by the axis and sends anAxisChangeEvent
to all registered listeners.
- Parameters:
value
- the value.
- See Also:
getSmallestValue()
public void setTickUnit(NumberTickUnit unit)
Sets the tick unit for the axis and sends anAxisChangeEvent
to all registered listeners. A side effect of calling this method is that the "auto-select" feature for tick units is switched off (you can restore it using theValueAxis.setAutoTickUnitSelection(boolean)
method).
- Parameters:
unit
- the new tick unit (null
not permitted).
- See Also:
getTickUnit()
public void setTickUnit(NumberTickUnit unit, boolean notify, boolean turnOffAutoSelect)
Sets the tick unit for the axis and, if requested, sends anAxisChangeEvent
to all registered listeners. In addition, an option is provided to turn off the "auto-select" feature for tick units (you can restore it using theValueAxis.setAutoTickUnitSelection(boolean)
method).
- Parameters:
unit
- the new tick unit (null
not permitted).notify
- notify listeners?turnOffAutoSelect
- turn off the auto-tick selection?
- See Also:
getTickUnit()
public double valueToJava2D(double value, Rectangle2D area, RectangleEdge edge)
Converts a value on the axis scale to a Java2D coordinate relative to the givenarea
, based on the axis running along the specifiededge
.
- Overrides:
- valueToJava2D in interface ValueAxis
- Parameters:
value
- the data value.area
- the area.edge
- the edge.
- Returns:
- The Java2D coordinate corresponding to
value
.