Style Intelligence v12.0

inetsoft.graph.scale
Class PowerScale

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

public class PowerScale
extends LinearScale

A power scale maps numeric values by raising it to the power of a specified number.

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
PowerScale()
          Default constructor.
PowerScale(double min, double max)
          Create a scale with user specified min and max.
PowerScale(String[] fields)
          Create a scale for the specified columns.
 
Method Summary
 double add(double v1, double v2)
          Add two mapped values to get the total value.
 double getExponent()
          Get the power to raise to.
 double[] getMinorTicks()
          Minor ticks are not supported by power scale.
 double[] getTicks()
          Get the tick positions.
 Object[] getValues()
          Get the values at each tick.
protected  double mapValue(double val)
          Return the power value.
 void setExponent(double power)
          Set the power to raise to.
 double unmap(double val)
          This is the reverse of mapValue.
 
Methods inherited from class inetsoft.graph.scale.LinearScale
clone, clone, getIncrement, getMax, getMin, getMinorIncrement, getScaleRange, getUnitCount, getUserMax, getUserMin, init, isReversed, isSharedRange, mapValue, setIncrement, setMax, setMin, setMinorIncrement, setReversed, setScaleRange, setSharedRange, toString
 
Methods inherited from class inetsoft.graph.scale.Scale
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

PowerScale

public PowerScale()
Default constructor.


PowerScale

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


PowerScale

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

Method Detail

setExponent

public void setExponent(double power)
Set the power to raise to. The default is 0.5.


getExponent

public double getExponent()
Get the power to raise to. The default is 0.5.


mapValue

protected double mapValue(double val)
Return the power value.

Overrides:
mapValue in class LinearScale

unmap

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

Overrides:
unmap in class LinearScale

add

public double add(double v1,
                  double v2)
Add two mapped values to get the total value.

Overrides:
add in class Scale
Parameters:
v1 - the specified mapped value a.
v2 - the specified mapped value b.
Returns:
the new total value.

getTicks

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

Overrides:
getTicks in class LinearScale
Returns:
double[] represent the logical position of each tick.

getValues

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

Overrides:
getValues in class LinearScale
Returns:
Object[] represent values on each tick.

getMinorTicks

public double[] getMinorTicks()
Minor ticks are not supported by power scale.

Overrides:
getMinorTicks in class LinearScale
Returns:
the minor ticks, null means need not to paint minor ticks.

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