org.jfree.chart.axis
public class LogarithmicAxis extends NumberAxis
Field Summary | |
---|---|
protected boolean | allowNegativesFlag Flag set true to allow negative values in data. |
protected boolean | autoRangeNextLogFlag True to make 'autoAdjustRange()' select "10^n" values. |
protected boolean | expTickLabelsFlag Flag set true for "1e#"-style tick labels. |
protected boolean | log10TickLabelsFlag Flag set true for "10^n"-style tick labels. |
static double | LOG10_VALUE Useful constant for log(10). |
protected NumberFormat | numberFormatterObj Number formatter for generating numeric strings. |
protected boolean | smallLogFlag Helper flag for log axis processing. |
protected boolean | strictValuesFlag
Flag set true make axis throw exception if any values are
<= 0 and 'allowNegativesFlag' is false. |
static double | SMALL_LOG_VALUE Smallest arbitrarily-close-to-zero value allowed. |
Constructor Summary | |
---|---|
LogarithmicAxis(String label)
Creates a new axis.
|
Method Summary | |
---|---|
double | adjustedLog10(double val)
Returns an adjusted log10 value for graphing purposes. |
double | adjustedPow10(double val)
Returns an adjusted power of 10 value for graphing purposes. |
void | autoAdjustRange()
Rescales the axis to ensure that all data is visible. |
protected double | computeLogCeil(double upper)
Returns the smallest (closest to negative infinity) double value that is
not less than the argument, is equal to a mathematical integer and
satisfying the condition that log base 10 of the value is an integer
(i.e., the value returned will be a power of 10: 1, 10, 100, 1000, etc.).
|
protected double | computeLogFloor(double lower)
Returns the largest (closest to positive infinity) double value that is
not greater than the argument, is equal to a mathematical integer and
satisfying the condition that log base 10 of the value is an integer
(i.e., the value returned will be a power of 10: 1, 10, 100, 1000, etc.).
|
boolean | getAllowNegativesFlag()
Returns the 'allowNegativesFlag' flag; true to allow negative values
in data, false to be able to plot positive values arbitrarily close
to zero.
|
boolean | getAutoRangeNextLogFlag()
Returns the 'autoRangeNextLogFlag' flag.
|
boolean | getExpTickLabelsFlag()
Returns the 'expTickLabelsFlag' flag.
|
boolean | getLog10TickLabelsFlag()
Returns the 'log10TickLabelsFlag' flag.
|
boolean | getStrictValuesFlag()
Returns the 'strictValuesFlag' flag; if true and 'allowNegativesFlag'
is false then this axis will throw a runtime exception if any of its
values are less than or equal to zero; if false then the axis will
adjust for values less than or equal to zero as needed.
|
double | java2DToValue(double java2DValue, Rectangle2D plotArea, RectangleEdge edge)
Converts a coordinate in Java2D space to the corresponding data
value, assuming that the axis runs along one edge of the specified
plotArea.
|
protected String | makeTickLabel(double val, boolean forceFmtFlag)
Converts the given value to a tick label string.
|
protected String | makeTickLabel(double val)
Converts the given value to a tick label string. |
protected List | refreshTicksHorizontal(Graphics2D g2, 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 | refreshTicksVertical(Graphics2D g2, 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).
|
void | setAllowNegativesFlag(boolean flgVal)
Sets the 'allowNegativesFlag' flag; true to allow negative values
in data, false to be able to plot positive values arbitrarily close to
zero.
|
void | setAutoRangeNextLogFlag(boolean flag)
Sets the 'autoRangeNextLogFlag' flag. |
void | setExpTickLabelsFlag(boolean flgVal)
Sets the 'expTickLabelsFlag' flag. |
void | setLog10TickLabelsFlag(boolean flag)
Sets the 'log10TickLabelsFlag' flag. |
void | setRange(Range range)
Overridden version that calls original and then sets up flag for
log axis processing.
|
void | setStrictValuesFlag(boolean flgVal)
Sets the 'strictValuesFlag' flag; if true and 'allowNegativesFlag'
is false then this axis will throw a runtime exception if any of its
values are less than or equal to zero; if false then the axis will
adjust for values less than or equal to zero as needed.
|
protected void | setupNumberFmtObj()
Sets up the number formatter object according to the
'expTickLabelsFlag' flag. |
protected void | setupSmallLogFlag()
Sets up flag for log axis processing. |
protected double | switchedLog10(double val)
Returns the log10 value, depending on if values between 0 and
1 are being plotted. |
double | switchedPow10(double val)
Returns a power of 10, depending on if values between 0 and
1 are being plotted. |
double | valueToJava2D(double value, Rectangle2D plotArea, RectangleEdge edge)
Converts a data value to a coordinate in Java2D space, assuming that
the axis runs along one edge of the specified plotArea.
|
void | zoomRange(double lowerPercent, double upperPercent)
Zooms in on the current range.
|
Parameters: label the axis label.
Parameters: val value for which log10 should be calculated.
Returns: An adjusted log10(val).
See Also: LogarithmicAxis
Parameters: val value for which power of 10 should be calculated.
Returns: An adjusted 10val.
Since: 1.0.5
See Also: LogarithmicAxis
Parameters: upper a double value above which a ceiling will be calcualted.
Returns: 10N with N .. { 1 ... }
Parameters: lower a double value below which a floor will be calcualted.
Returns: 10N with N .. { 1 ... }
Returns: The flag.
Returns: true
if the 'autoAdjustRange()' method will
select the next "10^n" values, false
if not.
Returns: true
for "1e#"-style tick labels,
false
for log10 or regular numeric tick labels.
Returns: true
for "10^n"-style tick labels,
false
for "1e#"-style or regular numeric tick
labels.
Returns: true
if strict enforcement is enabled.
Parameters: java2DValue the coordinate in Java2D space. plotArea the area in which the data is plotted. edge the axis location.
Returns: The data value.
Parameters: val the value to convert. forceFmtFlag true to force the number-formatter object to be used.
Returns: The tick label string.
Parameters: val the value to convert.
Returns: The tick label string.
Parameters: g2 the graphics device. 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 area in which the plot should be drawn. edge the location of the axis.
Returns: A list of ticks.
Parameters: flgVal the new value of the flag.
Parameters: flag true
to make the 'autoAdjustRange()'
method select the next "10^n" values, false
to not.
Parameters: flgVal true for "1e#"-style tick labels, false for log10 or regular numeric tick labels.
Parameters: flag true for "10^n"-style tick labels, false for "1e#"-style or regular numeric tick labels.
Parameters: range the new range.
Parameters: flgVal true for strict enforcement.
Parameters: val the value.
Returns: log10(val).
See Also: LogarithmicAxis
Parameters: val the value.
Returns: 10val.
Since: 1.0.5
See Also: LogarithmicAxis
Parameters: value the data value. plotArea the area for plotting the data. edge the axis location.
Returns: The Java2D coordinate.
Parameters: lowerPercent the new lower bound. upperPercent the new upper bound.