GraphElement.setShapeFrame(frame)

Specifies the aesthetic shape treatment for the chart elements. A ShapeFrame can shape-code chart elements by value, or simply specify a static shape style. The corresponding “getter” function is GraphElement.getShapeFrame().

Parameter

frame

A ShapeFrame object

Example

Chart Component Script
 dataset = [["State","Quantity","m1","m2", "m3"],["NJ",200,6,3,4],["NY",300,8,2,5]]; (1)
graph = new EGraph();
var frame = new StarShapeFrame(); (2)
var elem = new PointElement("State", "Quantity"); (3)
frame.setFields(["m1", "m2", "m3"]);
elem.setShapeFrame(frame); (4)
graph.addElement(elem); (5)
1 See dataset to use a data block instead of an array literal.
2 Create a StarShapeFrame object.
3 Create the PointElement object.
4 Use setShapeFrame to assign the StarShapeFrame to the PointElement.
5 Use addElement to add the PointElement to the Chart.

GraphElementsetShapeFrame

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 change the property on a Chart that was previously created with the Chart Editor, use “getter” methods such as EGraph.getElement(index) ① to obtain a handle to the desired GraphElement object. For example:

var elem = graph.getElement(0); (1)
var frame = new StarShapeFrame();
frame.setFields(["m1", "m2", "m3"]);
elem.setShapeFrame(frame);