Scale.setDataFields(arr)

Specifies the fields to use for initializing the Scale; i.e., determining the maximum and minimum values. If left unspecified, the values in the Scale.setDataFields(arr) property are used for this purpose. The corresponding “getter” function is getDataFields().

Parameter

arr

Array of Strings

Example

Chart Component Script
dataset = [["State","Quantity","Total"], ["NJ",100,0], ["NY",1500,30000]]; (1)
graph = new EGraph();
var qscale = new LogScale(); (2)
var elem = new IntervalElement("State", "Quantity");
qscale.setDataFields(["Total"]); (3)
graph.addElement(elem);
graph.setScale("Quantity", qscale); (4)
1 See dataset to use a data block instead of an array literal.
2 Create the Scale object.
3 Use setDataFields to initialize the Scale with the ‘Total’ field.
4 Use EGraph.setScale(field, scale) to assign the Scale to the Chart.

ScaleSetDataFields

Script that modifies the graph or dataset properties should be placed on the Chart component itself. See Add Component Script for more information. This script has access to the Chart data and Chart API methods. Scripted Charts are not good candidates for user-modification, so you should deselect ‘Enable Ad Hoc Editing’ in the Chart Properties dialog box.