CategoricalScale.setValues(value)

Specifies the categorical values in the scale, and their order. The corresponding “getter” function is getValues().

Parameter

value

Array of String

Example

Chart Component Script
dataset = [["State", "Quantity"], ["NJ", 200], ["NY", 300]]; (1)
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var sscale = new CategoricalScale("State"); (2)
var qscale = new LinearScale("Quantity");
var coord = new RectCoord(sscale, qscale); (3)
sscale.setValues(["NY","NJ"]); (4)
coord.transpose();
graph.setCoordinate(coord); (5)
graph.addElement(elem);
1 See dataset to use a data block instead of an array literal.
2 Create the CategoricalScale object.
3 Assign the scale to a Coordinate object.
4 Use setValues to assign the values to the CategoricalScale.
5 Assign the Coordinate to the Chart.

CategoricalScaleSetValues

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.