EGraph.setScale(field, scale)
|
Sets the specified Scale for the given axis. See Chart Coordinates for available scales. The corresponding “getter” function is EGraph.getScale(field).
Parameters
- field
-
name of axis to receive scale (String)
- scale
-
scale to apply to axis (Scale)
Example
Chart Component Script
dataset = [["State", "Quantity"], ["NJ", 200], ["NY", 300]];
graph = new EGraph();
var elem = new LineElement("State", "Quantity");
var qscale = new LinearScale("Quantity"); (1)
qscale.setMin(100);
qscale.setMax(500);
graph.addElement(elem);
graph.setScale("Quantity", qscale); (2)
| 1 | Create the Scale object. |
| 2 | Use setScale to add the Scale object to Chart.
|
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.
|
