Chart Builder API (beta)

oracle.ord.media.chart.types
Class TimeAxisDesc

java.lang.Object
  |
  +--oracle.ord.media.chart.types.AxisDesc
        |
        +--oracle.ord.media.chart.types.TimeAxisDesc

public class TimeAxisDesc
extends AxisDesc

TimeAxisDesc objects are used to customize time axes, and are normally supplied as arguments to setChartAttributes(). Users have control of all parameters inherited from AxisDesc, plus control over which time dimensions will be labeled.

In most cases, using the default settings will generate a visually pleasing labeling of the time axis. However, in some cases, users may wish to alter the minimum labeling dimension (using setMinDimension()) to avoid labeling seconds or minutes, or alter the maximum labeling dimension (using setMaxDimension()) to avoid labeling years.

Consider the following example, which sets the minimum (highest frequency) dimension to be labeled to DAY.

 
AxisChart myChart = new AxisChart();
... 
TimeAxisDesc myTimeAxisDesc = new TimeAxisDesc();
myTimeAxisDesc.setMinDimension(TimeAxisDesc.DAY);
myChart.setChartAttributes(myTimeAxisDesc);

See Also:
AxisChart.setChartAttributes(TimeAxisDesc), AxisDesc

Field Summary
static int DAY
          Labeling constant for Days.
static int DERIVED
          Constant indicating that the dimension is derived by the system.
static int HOUR
          Labeling constant for Hours.
static int MINUTE
          Labeling constant for Minutes.
static int MONTH
          Labeling constant for Months.
static int SECOND
          Labeling constant for Seconds.
static int YEAR
          Labeling constant for Years.
 
Constructor Summary
TimeAxisDesc()
           
 
Method Summary
 int getField(int timeDimension)
          Get the labeling convention for the specified time dimension.
 int getMaxDimension()
          Return the maximum dimension.
 int getMinDimension()
          Return the minimum dimension.
 int getMinLabelingLines()
          Return the minimum number of lines used to label the X-axis.
 void setField(int timeDimension, int field)
          Set the labeling convention for the specified time dimension.
 void setMaxDimension(int timeDimension)
          Set the maximum (lowest frequency) labeled dimension.
 void setMinDimension(int timeDimension)
          Set the minimum (highest frequency) labeled dimension.
 void setMinLabelingLines(int numLabelingLines)
          Set the minimum number of lines used to label the X-axis (for Strip charts).
 
Methods inherited from class oracle.ord.media.chart.types.AxisDesc
getColor, getDrawLabel, getFont, setColor, setDrawLabelOff, setFont
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DERIVED

public static final int DERIVED
Constant indicating that the dimension is derived by the system.

SECOND

public static final int SECOND
Labeling constant for Seconds.

MINUTE

public static final int MINUTE
Labeling constant for Minutes.

HOUR

public static final int HOUR
Labeling constant for Hours.

DAY

public static final int DAY
Labeling constant for Days.

MONTH

public static final int MONTH
Labeling constant for Months.

YEAR

public static final int YEAR
Labeling constant for Years.
Constructor Detail

TimeAxisDesc

public TimeAxisDesc()
Method Detail

setMinDimension

public void setMinDimension(int timeDimension)
                     throws ChartException
Set the minimum (highest frequency) labeled dimension. For example, setting the minimum to TimeAxisDesc.MONTH would generate labels for years and months. Setting the minimum to TimeAxisDesc.HOUR would generate labels for years, months, days, and hours.
Parameters:
timeDimension - Valid values are TimeAxisDesc.SECOND, TimeAxisDesc.MINUTE, TimeAxisDesc.HOUR, TimeAxisDesc.DAY, TimeAxisDesc.MONTH, or TimeAxisDesc.YEAR.

setMaxDimension

public void setMaxDimension(int timeDimension)
                     throws ChartException
Set the maximum (lowest frequency) labeled dimension. For example, setting the maximum to TimeAxisDesc.MONTH would generate labels for months and days.
Parameters:
timeDimension - Valid values are TimeAxisDesc.SECOND, TimeAxisDesc.MINUTE, TimeAxisDesc.HOUR, TimeAxisDesc.DAY, TimeAxisDesc.MONTH, or TimeAxisDesc.YEAR.

setField

public void setField(int timeDimension,
                     int field)
              throws ChartException
Set the labeling convention for the specified time dimension. For example, calling setField(TimeAxisDesc.HOUR, Calendar.HOUR_OF_DAY) asserts a 24-hour labeling for hours.

Note: At this time, alternate labeling conventions are currently supported for only TimeAxisDesc.HOUR.

Parameters:
timeDimension - The valid value is TimeAxisDesc.HOUR.
field - Valid values are: Calendar.HOUR, Calendar.HOUR_OF_DAY

getField

public int getField(int timeDimension)
             throws ChartException
Get the labeling convention for the specified time dimension.

getMinDimension

public int getMinDimension()
Return the minimum dimension.

getMaxDimension

public int getMaxDimension()
Return the maximum dimension.

setMinLabelingLines

public void setMinLabelingLines(int numLabelingLines)
Set the minimum number of lines used to label the X-axis (for Strip charts). This method is normally only used in the context of Strip charts to set the minimum number of lines used in labeling the X-axis. The default number of labeling lines is DERIVED. For example, an initial Strip chart may have no timestamps (as well as no data), and the default behavior will be to reserve no space for the timestamps. Subsequently, when the next point added to the Strip chart, space will be reserved for timestamps, causing a slight visual annoyance. This visual annoyance can be eliminated by setting the minimum number of lines used in the labeling of the X-axis.

getMinLabelingLines

public int getMinLabelingLines()
Return the minimum number of lines used to label the X-axis.

Chart Builder API (beta)