PowerScale
The PowerScale object contains a scale that maps values to physical attributes by raising them to a specified exponent. To create a PowerScale object, call the PowerScale constructor.
var qscale = new PowerScale('Last Year', 'This Year');
You can pass the names of the fields (e.g., ‘Last Year’, ‘This Year’) for which the scale should be generated to the constructor, or specify these later using the inherited Scale.setFields(field) property. A PowerScale.setExponent(value) method is also avilable.
Example
Chart Component Script
dataset = [["State", "Quantity"], ["NJ",200], ["NY",300]]; (1)
graph = new EGraph();
var qscale = new PowerScale(); (2)
qscale.setFields(["Quantity"]); (3)
var elem = new IntervalElement("State", "Quantity");
qscale.setExponent(0.5);
graph.setScale("Quantity", qscale); (4)
graph.addElement(elem);
| 1 | See dataset to use a data block instead of an array literal. |
| 2 | Create the PowerScale object. |
| 3 | Compute the PowerScale using the “Quantity” field. |
| 4 | Use EGraph.setScale(field, scale) to add the Scale to the Chart for the “Quantity” field. |

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.
|