Style Intelligence v12.0

inetsoft.graph.scale
Class StackRange

java.lang.Object
  extended by inetsoft.graph.scale.AbstractScaleRange
      extended by inetsoft.graph.scale.StackRange
All Implemented Interfaces:
ScaleRange, Serializable, Cloneable

public class StackRange
extends AbstractScaleRange

Calculate the range by stacking the values. The stacking could be applied to all values, or each group.

See Also:
Serialized Form

Field Summary
static String ROWID
          A special column name to return an unique row id for group field.
 
Constructor Summary
StackRange()
           
 
Method Summary
 void addStackFields(String[] cols)
          Set the fields to stack together.
 double[] calculate(DataSet data, String[] cols)
          Calculate the min and max.
 String getGroupField()
          Get the group field.
 boolean isStackNegative()
          Check if negative values are stacked separately.
 void setGroupField(String gfield)
          Set the group field.
 void setStackNegative(boolean negGrp)
          Set whether negative values are stacked separately.
 
Methods inherited from class inetsoft.graph.scale.AbstractScaleRange
getValue, isAbsoluteValue, setAbsoluteValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROWID

public static final String ROWID
A special column name to return an unique row id for group field.

See Also:
Constant Field Values
Constructor Detail

StackRange

public StackRange()
Method Detail

getGroupField

public String getGroupField()
Get the group field.


setGroupField

public void setGroupField(String gfield)
Set the group field. If the group field is set, data is grouped and stacking range is calculated for each group. This is usually the column bound to the X axis.

Parameters:
gfield - the group field column name, or ROWID to treat each row as a group.

isStackNegative

public boolean isStackNegative()
Check if negative values are stacked separately.


setStackNegative

public void setStackNegative(boolean negGrp)
Set whether negative values are stacked separately. If true (default), the negative values are stacked downward and positive values are stacked upward. Otherwise, all values are accumulated together.


addStackFields

public void addStackFields(String[] cols)
Set the fields to stack together. If this is not called, all fields are stacked. For example, a range for two measures, A and B, will be calculated as the sum of all values in A and B by default. If they are add to stack fields as [A] and [B], then the range is the max of the sum of A and sum of B instead.


calculate

public double[] calculate(DataSet data,
                          String[] cols)
Calculate the min and max.

Parameters:
data - the dataset.
cols - the numeric columns to find range values.
Returns:
an array of two values, minimum and maximum of the range.

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