Style Intelligence v12.0

inetsoft.graph.scale
Class CategoricalScale

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

public class CategoricalScale
extends Scale

A categorical scale is used to map nominal values to their logical position.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class inetsoft.graph.scale.Scale
Scale.Value
 
Field Summary
 
Fields inherited from class inetsoft.graph.scale.Scale
GAPS, MAX_VALUE, MIN_VALUE, NO_NULL, RAW, TICKS, ZERO, ZERO_VALUE
 
Constructor Summary
CategoricalScale()
          Default constructor.
CategoricalScale(String[] fields)
          Create a categorical scale for the specified fields.
 
Method Summary
 void addValue(Object val)
          Add a value to the categorical list.
 Object clone()
          Clone this object.
 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 getUnitCount()
          Categorical scale is divided into same number of units as the weighted number of ticks plus the gap on each side.
 Object[] getValues()
          Get the values at each tick.
 void init(DataSet data)
          Initialize the scale to use the values in the chartLens.
 void init(Object[] vals)
          Initialize the scale with the supplied value.
 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 setFill(boolean fill)
          Set whether the scale should fill or leave gaps at two sides.
 void setScaleOption(int option)
          Override the setScaleOption method to provide the ability to remove null for the notShowNull combobox.
 void setValues(Object[] vals)
          Set the values on the scale.
 
Methods inherited from class inetsoft.graph.scale.Scale
add, createScale, equals, getAxisSpec, getDataFields, getFields, getScaleOption, hashCode, map, setAxisSpec, setDataFields, setFields, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CategoricalScale

public CategoricalScale()
Default constructor. The categorical values must be explicitly set.


CategoricalScale

public CategoricalScale(String[] fields)
Create a categorical scale for the specified fields.

Method Detail

init

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

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

setScaleOption

public void setScaleOption(int option)
Override the setScaleOption method to provide the ability to remove null for the notShowNull combobox.

Overrides:
setScaleOption in class Scale

init

public void init(Object[] vals)
Initialize the scale with the supplied value. This values may be trimmed if it exceed the maximum size.


mapValue

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

Specified by:
mapValue in class Scale
Parameters:
val - the value need to get the logical position.
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.

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.

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.

setValues

public void setValues(Object[] vals)
Set the values on the scale. The values will be used as the categorical values until the next setValues is called. The init() calls are ignored if the values are explicitly set.


addValue

public void addValue(Object val)
Add a value to the categorical list.


setFill

public void setFill(boolean fill)
Set whether the scale should fill or leave gaps at two sides.


isFill

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


getUnitCount

public int getUnitCount()
Categorical scale is divided into same number of units as the weighted number of ticks plus the gap on each side.

Overrides:
getUnitCount in class Scale

clone

public Object clone()
Clone this object.

Overrides:
clone in class Scale

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