Style Intelligence v12.0

inetsoft.graph.scale
Class LinearScale

java.lang.Object
  extended by inetsoft.graph.scale.Scale
      extended by inetsoft.graph.scale.LinearScale
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
LogScale, PowerScale

public class LinearScale
extends Scale

A linear scale is used to map numeric 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
 
Fields inherited from class inetsoft.graph.scale.Scale
GAPS, MAX_VALUE, MIN_VALUE, NO_NULL, RAW, TICKS, ZERO, ZERO_VALUE
 
Constructor Summary
LinearScale()
          Default constructor.
LinearScale(double min, double max)
          Create a scale with user specified min and max.
LinearScale(String[] flds)
          Create a scale for the specified column.
 
Method Summary
 Object clone()
          Clone this object.
 Object clone(boolean srange)
          Clone this object.
 Number getIncrement()
          Get the tick increment.
 double getMax()
          Get the maximum value on the scale.
 double getMin()
          Get the minimum value on the scale.
 Number getMinorIncrement()
          Get the tick minor increment.
 double[] getMinorTicks()
          Get the minor tick positions.
 ScaleRange getScaleRange()
          Get the calculation stratgy for finding scale range.
 double[] getTicks()
          Get the tick positions.
 int getUnitCount()
          The unit count of a linear scale is the number of smallest intervals on the scale.
 Number getUserMax()
          Get the user defined maximum value on the scale.
 Number getUserMin()
          Get the user defined minimum value on the scale.
 Object[] getValues()
          Get the values at each tick.
 void init(DataSet data)
          Initialize the scale to use the values in the dataset.
 boolean isReversed()
          Check whether the scale is reversed (from largest to smallest).
 boolean isSharedRange()
          Check whether to share the range across an entire facet graph.
protected  double mapValue(double val)
          Performing any mapping from the original value to the scale value (e.g.
 double mapValue(Object val)
          Map a value to a logical position using this scale.
 void setIncrement(Number increment)
          Set the tick increment.
 void setMax(Number max)
          Set the maximum value of the scale.
 void setMin(Number min)
          Set the minimum value of the scale.
 void setMinorIncrement(Number minorinc)
          Set the tick minor increment.
 void setReversed(boolean reversed)
          Set whether the scale should be reversed (from largest to smallest).
 void setScaleRange(ScaleRange range)
          Set the calculation stratgy for finding scale range.
 void setSharedRange(boolean shared)
          Set whether to share the range across an entire facet graph.
 String toString()
          Get the string representation.
 double unmap(double val)
          This is the reverse of mapValue.
 
Methods inherited from class inetsoft.graph.scale.Scale
add, createScale, equals, getAxisSpec, getDataFields, getFields, getScaleOption, hashCode, map, setAxisSpec, setDataFields, setFields, setScaleOption
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearScale

public LinearScale()
Default constructor.


LinearScale

public LinearScale(double min,
                   double max)
Create a scale with user specified min and max.


LinearScale

public LinearScale(String[] flds)
Create a scale for the specified column.

Method Detail

setScaleRange

public void setScaleRange(ScaleRange range)
Set the calculation stratgy for finding scale range.


getScaleRange

public ScaleRange getScaleRange()
Get the calculation stratgy for finding scale range.


setReversed

public void setReversed(boolean reversed)
Set whether the scale should be reversed (from largest to smallest).


isReversed

public boolean isReversed()
Check whether the scale is reversed (from largest to smallest).


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.

getUnitCount

public int getUnitCount()
The unit count of a linear scale is the number of smallest intervals on the scale.

Overrides:
getUnitCount in class Scale

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;

mapValue

protected double mapValue(double val)
Performing any mapping from the original value to the scale value (e.g. log or power).


unmap

public double unmap(double val)
This is the reverse of mapValue.


getMin

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

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

setMin

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


getMax

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

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

setMax

public void setMax(Number max)
Set the maximum value of the 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.

getIncrement

public Number getIncrement()
Get the tick increment.

Returns:
the tick increment.

setIncrement

public void setIncrement(Number increment)
Set the tick increment.

Parameters:
increment - the increment to set.

getMinorIncrement

public Number getMinorIncrement()
Get the tick minor increment.

Returns:
Returns the minor increment.

setMinorIncrement

public void setMinorIncrement(Number minorinc)
Set the tick minor increment.

Parameters:
minorinc - the minor increment to set.

getMinorTicks

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

Returns:
the minor ticks, null means need not to paint minor ticks.

setSharedRange

public void setSharedRange(boolean shared)
Set whether to share the range across an entire facet graph.


isSharedRange

public boolean isSharedRange()
Check whether to share the range across an entire facet graph.


clone

public Object clone(boolean srange)
Clone this object.

Parameters:
srange - true to share range, false otherwise.
Returns:
the cloned object.

clone

public Object clone()
Clone this object.

Overrides:
clone in class Scale

getUserMax

public Number getUserMax()
Get the user defined maximum value on the scale.

Returns:
the maximum value of the scale range in logical coordinate.

getUserMin

public Number getUserMin()
Get the user defined minimum value on the scale.

Returns:
the minimum value of the scale range in logical coordinate.

toString

public String toString()
Get the string representation.

Overrides:
toString in class Scale

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