EGraph.removeElement(idx)

Removes the specified GraphElement from the chart. See Chart Elements for available elements. Element objects are indexed in the order that they are added to the chart, beginning with index 0. To add an Element, use EGraph.addElement(elem).

Parameter

idx

a GraphElement object

Example

Chart Component Script
dataset = [["State", "Quantity"], ["NJ", 200], ["NY", 300]]; (1)
graph = new EGraph();
var elem = new LineElement("State", "Quantity");
graph.addElement(elem); (2)
graph.removeElement(0); (3)
1 See dataset to use a data block instead of an array literal.
2 Add the LineElement to Chart.
3 Use removeElement() to remove the LineElement.
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.

To use the property on a Chart that was previously created with the Chart Editor, simply call the function. For example:

graph.removeElement(0);