Style Intelligence v12.0

inetsoft.graph.scale
Class TimeScale

java.lang.Object
  extended by inetsoft.graph.scale.Scale
      extended by inetsoft.graph.scale.TimeScale
All Implemented Interfaces:
Serializable, Cloneable

public class TimeScale
extends Scale

A time scale is used to map date/time values on a linear scale.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class inetsoft.graph.scale.Scale
Scale.Value
 
Field Summary
static int DAY
          Day interval.
static int HOUR
          Hour interval.
static int MINUTE
          Minute interval.
static int MONTH
          Month interval.
static int QUARTER
          Quarter interval.
static int SECOND
          Second interval.
static int WEEK
          Week interval.
static int YEAR
          Year interval.
 
Fields inherited from class inetsoft.graph.scale.Scale
GAPS, MAX_VALUE, MIN_VALUE, NO_NULL, RAW, TICKS, ZERO, ZERO_VALUE
 
Constructor Summary
TimeScale()
          Default constructor.
TimeScale(Date min, Date max)
          Create a scale with user specified min and max.
TimeScale(String[] fields)
          Create a scale for the specified columns.
 
Method Summary
 AxisSpec getAxisSpec()
          Get the associated axis attributes.
 Number getIncrement()
          Get the tick increment.
 double getMax()
          Get the maximum value on the scale.
 double getMin()
          Get the minimum value on the scale.
 double[] getTicks()
          Get the tick positions.
 int getType()
          Get the date type defined in TimeScale.
 int getUnitCount()
          Each interval of the time scale is treated as an unit.
 Object[] getValues()
          Get the values at each tick.
 void init(DataSet data)
          Initialize the scale to use the values in the dataset.
 boolean isFill()
          Check whether the scale should fill or leave gaps at two sides.
 double mapValue(Object val)
          Map a value to a logical position using this scale.
 void setAxisSpec(AxisSpec axisSpec)
          Set the attribute for creating the axis for this scale.
 void setFill(boolean fill)
           
 void setIncrement(Number increment)
          Set the tick increment.
 void setMax(Date max)
          Set the maximum value of the scale.
 void setMin(Date min)
          Set the minimum value of the scale.
 void setType(int type)
          Set the date type defined in TimeScale.
 
Methods inherited from class inetsoft.graph.scale.Scale
add, clone, createScale, equals, getDataFields, getFields, getScaleOption, hashCode, map, setDataFields, setFields, setScaleOption, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SECOND

public static final int SECOND
Second interval.

See Also:
Constant Field Values

MINUTE

public static final int MINUTE
Minute interval.

See Also:
Constant Field Values

HOUR

public static final int HOUR
Hour interval.

See Also:
Constant Field Values

DAY

public static final int DAY
Day interval.

See Also:
Constant Field Values

WEEK

public static final int WEEK
Week interval.

See Also:
Constant Field Values

MONTH

public static final int MONTH
Month interval.

See Also:
Constant Field Values

QUARTER

public static final int QUARTER
Quarter interval.

See Also:
Constant Field Values

YEAR

public static final int YEAR
Year interval.

See Also:
Constant Field Values
Constructor Detail

TimeScale

public TimeScale()
Default constructor.


TimeScale

public TimeScale(Date min,
                 Date max)
Create a scale with user specified min and max.


TimeScale

public TimeScale(String[] fields)
Create a scale for the specified columns.

Method Detail

init

public void init(DataSet data)
Initialize the scale to use the values in the dataset.

Specified by:
init in class Scale
Parameters:
data - is chart data table.

mapValue

public double mapValue(Object val)
Map a value to a logical position using this scale.

Specified by:
mapValue in class Scale
Returns:
double represent the logical position of this value;

getMin

public double getMin()
Get the minimum value on the scale.

Specified by:
getMin in class Scale
Returns:
the min value of the scale in logical coordinate.

setMin

public void setMin(Date min)
Set the minimum value of the scale.

Parameters:
min - the min date.

getMax

public double getMax()
Get the maximum value on the scale.

Specified by:
getMax in class Scale
Returns:
the max value of the scale in logical coordinate.

setMax

public void setMax(Date max)
Set the maximum value of the scale.


getType

public int getType()
Get the date type defined in TimeScale.


setType

public void setType(int type)
Set the date type defined in TimeScale. If this is not set, the type is derived from the actual time data by approximating the smallest interval between dates.

Parameters:
type - the specified date type, e.g. MONTH, YEAR.

getIncrement

public Number getIncrement()
Get the tick increment.


setIncrement

public void setIncrement(Number increment)
Set the tick increment. If the increment is null, an increment is calculated automatically. If the increment is set to a positive integer, it's the number of period (e.g. Month for month interval scale) to increment for ticks.


getUnitCount

public int getUnitCount()
Each interval of the time scale is treated as an unit.

Overrides:
getUnitCount in class Scale

getTicks

public double[] getTicks()
Get the tick positions. The values of the ticks are logical coordinate position same as the values returned by map().

Specified by:
getTicks in class Scale
Returns:
double[] represent the logical position of each tick.

getValues

public Object[] getValues()
Get the values at each tick.

Specified by:
getValues in class Scale
Returns:
Object[] represent values on each tick.

setFill

public void setFill(boolean fill)

isFill

public boolean isFill()
Check whether the scale should fill or leave gaps at two sides.

Returns:
true if fill the gaps at two sides, false otherwise.

setAxisSpec

public void setAxisSpec(AxisSpec axisSpec)
Set the attribute for creating the axis for this scale.

Overrides:
setAxisSpec in class Scale

getAxisSpec

public AxisSpec getAxisSpec()
Get the associated axis attributes.

Overrides:
getAxisSpec in class Scale

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.