Scale.init(dataset)

Forces the immediate computation of the automatic scale attributes. The init() method is only required if you need to access automatically-computed scale attributes within your chart script. These attributes are not available within a script until the scale is initialized via the init() method.

Parameter

dataset The Chart dataset attribute

Note: Script that modifies 'graph' should be placed at the element level. See Adding Element-Level Script in Report Scripting and Adding Component Script in Dashboard Scripting for more information.

Example (Report or Viewsheet)

dataset = [["State", "Quantity"], ["NJ",200], ["NY",300]];

graph = new EGraph();

var qscale = new LinearScale("Quantity");

var elem = new IntervalElement("State", "Quantity")

qscale.init(dataset)

var defaultMax = qscale.getMax();

qscale.setMax(defaultMax + defaultMax/2);

graph.setScale("Quantity", qscale);

graph.addElement(elem);

See Also

DataSet, to use a Data Block or query as the dataset source.

<< CR.6.8 Scale © 1996-2013 InetSoft Technology Corporation (v11.4) Scale.setAxisSpec(spec) >>