JIDE 3.5.15

com.jidesoft.chart.axis
Class NumericAxis

java.lang.Object
  extended by com.jidesoft.chart.axis.Axis
      extended by com.jidesoft.chart.axis.NumericAxis
All Implemented Interfaces:
PropertyChangeListener, EventListener
Direct Known Subclasses:
IntegerAxis

public class NumericAxis
extends Axis

An axis class specialised for numeric values.

For example, if you create a NumericAxis with the following code:

 NumericAxis axis = new NumericAxis(0, 100, "X Axis")
 

you generate an axis which, when used as the x axis, looks as follows:

Numeric Axis Screenshot


Field Summary
 
Fields inherited from class com.jidesoft.chart.axis.Axis
MIN_RESOLUTION, PROPERTY_AXIS_COLOR, PROPERTY_LABEL, PROPERTY_MINOR_TICK_COLOR, PROPERTY_MINOR_TICK_LENGTH, PROPERTY_RANGE, PROPERTY_STROKE, PROPERTY_TICK_CALCULATOR, PROPERTY_TICK_COLOR, PROPERTY_TICK_FONT, PROPERTY_TICK_LABEL_COLOR, PROPERTY_TICK_LENGTH, PROPERTY_TICKS, PROPERTY_UPDATE_OTHER_AXES
 
Constructor Summary
NumericAxis()
          The default constructor creates an axis that ranges from 0.0 to 1.0, and no axis label.
NumericAxis(AutoPositionedLabel label)
          Creates an axis ranging from 0.0 to 1.0 and with the supplied object as the label
NumericAxis(double min, double max)
          Creates an axis ranging from min to max, but without an axis label
NumericAxis(double min, double max, String text)
          Creates an axis ranging from min to max, and the supplied text as the axis label
NumericAxis(Range<?> range)
          Creates an axis using the supplied range
NumericAxis(Range<?> range, String text)
          Creates an axis using the supplied range and the given text as the axis label
NumericAxis(String text)
          Creates an axis ranging from 0.0 to 1.0 and with the supplied text as an axis label
 
Method Summary
 AxisQuantity getQuantity()
          Returns the NUMBER quantity
protected  void init()
           
 void setNumberFormat(NumberFormat numberFormat)
          Sets the number format used when rendering ticks on the axis
 void setNumberFormat(String numberFormat)
          Sets the number format used when rendering ticks on the axis.
 
Methods inherited from class com.jidesoft.chart.axis.Axis
addPropertyChangeListener, equals, getAxisColor, getAxisRenderer, getAxisTransform, getDomain, getFloatingPosition, getLabel, getLabelWidth, getMinorTickColor, getMinorTickLength, getOutputRange, getPlacement, getRange, getStroke, getTickCalculator, getTickColor, getTickFont, getTickLabelColor, getTickLabelOffset, getTickLabelRotation, getTickLength, getTicks, hashCode, isFlipped, isLabelVisible, isTicksVisible, isVisible, labelWidth, labelWidth, maximum, midPoint, minimum, propertyChange, removePropertyChangeListener, render, setAxisColor, setAxisRenderer, setAxisTransform, setDomain, setFlipped, setFloatingPosition, setLabel, setLabel, setLabelVisible, setLabelWidth, setMinorTickColor, setMinorTickLength, setPlacement, setRange, setRange, setRange, setRange, setStroke, setTickCalculator, setTickColor, setTickFont, setTickLabelColor, setTickLabelOffset, setTickLabelRotation, setTickLength, setTicksVisible, setVisible, toString, updateTicks, zoom, zoomFromPosition
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericAxis

public NumericAxis()
The default constructor creates an axis that ranges from 0.0 to 1.0, and no axis label.


NumericAxis

public NumericAxis(String text)
Creates an axis ranging from 0.0 to 1.0 and with the supplied text as an axis label

Parameters:
text - the label for the axis

NumericAxis

public NumericAxis(AutoPositionedLabel label)
Creates an axis ranging from 0.0 to 1.0 and with the supplied object as the label

Parameters:
label - the label object that will be placed in the centre of the axis

NumericAxis

public NumericAxis(double min,
                   double max)
Creates an axis ranging from min to max, but without an axis label

Parameters:
min - the minimum value of the axis range
max - the maximum value of the axis range

NumericAxis

public NumericAxis(double min,
                   double max,
                   String text)
Creates an axis ranging from min to max, and the supplied text as the axis label

Parameters:
min - the minimum value of the axis range
max - the maximum value of the axis range
text - the text to use for the axis label

NumericAxis

public NumericAxis(Range<?> range)
Creates an axis using the supplied range

Parameters:
range - the range of the axis

NumericAxis

public NumericAxis(Range<?> range,
                   String text)
Creates an axis using the supplied range and the given text as the axis label

Parameters:
range - the range of the axis
text - the text to use as the axis label
Method Detail

init

protected void init()

setNumberFormat

public void setNumberFormat(NumberFormat numberFormat)
Sets the number format used when rendering ticks on the axis

Parameters:
numberFormat - the format to use
See Also:
NumberFormat

setNumberFormat

public void setNumberFormat(String numberFormat)
Sets the number format used when rendering ticks on the axis. For example, "#0.00" will display the string to 2 decimal places

Parameters:
numberFormat - the format string to use
See Also:
DecimalFormat

getQuantity

public AxisQuantity getQuantity()
Returns the NUMBER quantity

Overrides:
getQuantity in class Axis
Returns:
the NUMBER quantity

JIDE 3.5.15