StaticSizeFrame
The StaticSizeFrame object contains a size frame defined by explicit size data in the VisualFrame.setField(field) column, or by the fixed size in StaticSizeFrame.setSize(value). To create a StaticSizeFrame object, call the StaticSizeFrame constructor.
var frame = new StaticSizeFrame(10);
You can pass the numerical size (e.g., 10) to the constructor, or specify this later using StaticSizeFrame.setSize(value). You can also assign a SizeFrame using the bindingInfo.sizeFrame property in onRefresh script. See Example 2 below.
Example 1
dataset = [["State","Quantity","Size"],["NJ",200,1], ["NY",300,10]]; (1)
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var frame = new StaticSizeFrame(); (2)
frame.setField("Size");
elem.setSizeFrame(frame); (3)
graph.addElement(elem);
| 1 | See dataset to use a data block instead of an array literal. |
| 2 | Create the StaticSizeFrame object. |
| 3 | Use GraphElement.setSizeFrame(frame) to add the StaticSizeFrame to the IntervalElement.
|
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.
|
Example 2
This example illustrates how to use bindingInfo properties to control the SizeFrame.
-
Bind a Point Chart to the sample ‘All Sales’ Data Worksheet, with ‘Company’ (top 5) on the X-axis, and Sum(Total) on the Y-axis.
The ‘All Sales’ Data Worksheet can be found in the folder. You may need to download the examples.zip file from GitHub into your environment. (This requires access to Enterprise Manager.) See Import and Export Assets for instructions on how to import. -
Add the following script in the onRefresh handler. (See Add Dashboard Script.)
onRefresh ScriptChart1.bindingInfo.setSizeField("Company",Chart.STRING); Chart1.bindingInfo.sizeFrame = new StaticSizeFrame; Chart1.bindingInfo.sizeFrame.setSize(30);
Dashboard script that modifies bindingInfoshould generally be placed in the onRefresh handler. See Add Dashboard Script.
