Scale.setScaleOption(value)
Specifies a scaling option for the default scaling. The Scale.TICKS and Scale.ZERO options determine the maximum and minimum values that are used to calculate the scale range.
The Scale.TICKS option uses the maximum and minimum tick values (i.e., rounded numbers) rather than the maximum and minimum data values. The Scale.ZERO option uses zero as the minimum rather than the minimum data value (if positive). To combine multiple options, use the pipe (“or”) operator:
qscale.setScaleOption(Scale.ZERO | Scale.TICKS);
Parameter
value
Scale.NO_NULL (remove NULL-data gaps in scale)
Scale.TICKS (use ticks in scale range calculation)
Scale.ZERO (use zero in scale range)
Example (Report or Viewsheet)
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.data)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.coord)
var arr = [["State", "Quantity"], ["NJ", 200], ["NY", 300]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var sscale = new CategoricalScale("State");
var qscale = new LinearScale("Quantity");
var coord = new RectCoord(sscale,qscale);
qscale.setScaleOption(Scale.ZERO);
graph.setCoordinate(coord);
graph.addElement(elem);