GraphElement.getTextFrame()

Retrieves the element’s TextFrame. The corresponding “setter” function is GraphElement.setTextFrame(frame).

Returns

A TextFrame object

Example

Chart Component Script
var elem = graph.getElement(0); (1)
var frame = elem.getTextFrame(); (2)
// Compact syntax: var frame = graph.getElement(0).getTextFrame();

frame.setText('NJ','New Jersey'); (3)
frame.setText('NY','New York'); (3)
1 Obtain a handle to the GraphElement object.
2 Use getTextFrame to obtain a handle to the TextFrame object.
3 Set the desired properties of the TextFrame object.
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:
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.