GraphElement.getTextSpec(field)
Retrieves the TextSpec for a field representing text attributes such as color, font, format, etc. The corresponding “setter” function is GraphElement.setTextSpec(spec).
Returns
A TextSpec object
Example
Chart Component Script
var elem = graph.getElement(0); (1)
var spec = elem.getTextSpec("Sum(Product:Total)"); (2)
spec.setColor(java.awt.Color(0xff0000)); (3)
| 1 | Obtain a handle to the GraphElement object. |
| 2 | Use getTextSpec to obtain a handle to the TextSpec for the Product:Total measure. |
| 3 | Set the desired properties of the TextSpec 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.
|