EGraph.getFormCount()

Returns the number of forms currently present on the chart.

Returns

Integer

Number of form objects

Chart Component Script
dataset = [["State", "Quantity"], ["NJ", 200], ["NY", 300]]; (1)
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
graph.addForm(new LineForm()); (2)
graph.addForm(new LineForm()); (2)
graph.addForm(new LineForm()); (2)
var formCount = graph.getFormCount(); (3)
for (var i=0; i<formCount; i++) {
  graph.getForm(i).addValues(['NJ',i*100]);
  graph.getForm(i).addValues(['NY',300]);
  graph.getForm(i).setColor(java.awt.Color(0xff0000));
}
graph.addElement(elem);
1 See dataset to use a data block instead of an array literal.
2 Add GraphForm objects to Chart.
3 Use getFormCount to return the number of GraphForms.

EGraphgetFormCount

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.