RectCoord

The RectCoord object contains rectangular coordinates against which data can be represented. To create a RectCoord object, pass a pair of Scale objects to the RectCoord constructor:

var rect = new RectCoord(xscale,yscale);

You can pass a set of Scale objects (e.g., ‘xscale’, ‘yscale’, etc.) to the constructor, or specify this later using the RectCoord.setXScale(scale) and RectCoord.setYScale(scale) properties.

The following special methods are available.

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"); (2)
var coord = new RectCoord(sscale,qscale); (3)
graph.setCoordinate(coord); (4)
graph.addElement(elem);
1 See dataset to use a data block instead of an array literal.
2 Create the Scale objects.
3 Create the RectCoord object from the Scale objects.
4 Use EGraph.setCoordinate(coord) to add the RectCoord to the Chart.

RectCoord

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.