SchemaElement

The SchemaElement object contains user-defined visual elements that can be added to the graph. To create a new SchemaElement object, call the SchemaElement constructor.

var elem = new SchemaElement("State", "Quantity");

You can pass a set of field names (e.g., ‘State’, ‘Quantity’) to the constructor, or specify these later using the inherited GraphElement.addDim(field) and GraphElement.addVar(field) methods.

The following special methods are provided:

Example

Chart Component Script
dataset = [["State","Hi","Upper","Median","Lower","Lo"],["NJ",200,180,150,120,100],
["NJ",220,170,140,110,105],["NY",300,250,230, 150,80]]; (1)
graph = new EGraph();
var elem = new SchemaElement(); (2)
elem.addDim("State");
elem.addSchema("Hi","Upper","Median","Lower","Lo");
elem.setPainter(new BoxPainter());
graph.addElement(elem); (3)
1 See dataset to use a data block instead of an array literal.
2 Create the SchemaElement object.
3 Use EGraph.addElement(elem) to add the PointElement to the Chart.

SchemaElement

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.