JIDE 3.5.15

com.jidesoft.chart.axis
Class TimeAxis

java.lang.Object
  extended by com.jidesoft.chart.axis.Axis
      extended by com.jidesoft.chart.axis.TimeAxis
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class TimeAxis
extends Axis

An axis class specialised for time-based values. The values along the axis are given as the number of milliseconds since 00:00hrs on January 1st 1970, which is the same as the value returned when you call System.currentTimeMillis().

Note that as all axis types are based on double values, it is sometimes necessary to cast from a long to a double when adding time points or to cast from a double to a long when reading them off a chart.


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
TimeAxis()
          Constructs a time axis with a default time range and tick calculator.
TimeAxis(AutoPositionedLabel label)
          Constructs a time axis with a default time range and tick calculator, and sets the supplied object to be the label for the axis.
TimeAxis(long min, long max)
          Constructs a time axis using the supplied time range.
TimeAxis(String text)
          Constructs a time axis with a default time range and tick calculator, and uses the supplied text as the axis label.
TimeAxis(TimeRange timeRange)
          Constructs a time axis using the supplied time range
TimeAxis(TimeRange timeRange, String text)
          Constructs a time axis using the supplied time range and the text as the axis label
 
Method Summary
protected  TimeRange createDefaultRange()
           
 DateFormat getDateFormat()
           
 AxisQuantity getQuantity()
          Returns the TIME quantity
 TimeZone getTimeZone()
           
protected  void init()
           
 void setDateFormat(DateFormat dateFormat)
           
 void setTimeZone(TimeZone timeZone)
           
 TimeAxis withDateFormat(DateFormat dateFormat)
           
 
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

TimeAxis

public TimeAxis()
Constructs a time axis with a default time range and tick calculator.


TimeAxis

public TimeAxis(String text)
Constructs a time axis with a default time range and tick calculator, and uses the supplied text as the axis label.

Parameters:
text - the text for the axis label

TimeAxis

public TimeAxis(AutoPositionedLabel label)
Constructs a time axis with a default time range and tick calculator, and sets the supplied object to be the label for the axis.

Parameters:
label - the axis label

TimeAxis

public TimeAxis(long min,
                long max)
Constructs a time axis using the supplied time range.

Parameters:
min - the minimum value of the time range, in milliseconds since Jan 1st 1970
max - the maximum value of the time range, in milliseconds since Jan 1st 1970

TimeAxis

public TimeAxis(TimeRange timeRange)
Constructs a time axis using the supplied time range

Parameters:
timeRange - the time range to use for the axis

TimeAxis

public TimeAxis(TimeRange timeRange,
                String text)
Constructs a time axis using the supplied time range and the text as the axis label

Parameters:
timeRange - the time range to use for the axis
text - the text to use for the axis label
Method Detail

createDefaultRange

protected TimeRange createDefaultRange()

init

protected void init()

setDateFormat

public void setDateFormat(DateFormat dateFormat)

getDateFormat

public DateFormat getDateFormat()

withDateFormat

public TimeAxis withDateFormat(DateFormat dateFormat)

getTimeZone

public TimeZone getTimeZone()

setTimeZone

public void setTimeZone(TimeZone timeZone)

getQuantity

public AxisQuantity getQuantity()
Returns the TIME quantity

Overrides:
getQuantity in class Axis
Returns:
the TIME quantity

JIDE 3.5.15