StaticLineFrame.setLine(value)
Specifies the static line style for graphical elements in element script . If the data in the column assigned to the inherited VisualFrame.setField(field) property are GLine objects, these data values are used instead of the setLine() value. You can also set this using the bindingInfo.lineFrame.line property syntax in onRefresh script . See Example 2 below. The corresponding “getter” function is getLine().
Parameter
- value
-
A GLine constant or
Chart.NONEfor empty border:GLine.THIN_LINE GLine.DOT_LINE GLine.DASH_LINE GLine.MEDIUM_DASH GLine.LARGE_DASH
Example 1
dataset = [["State", "Quantity"], ["NJ", 300], ["NY", 200]]; (1)
graph = new EGraph();
var elem = new PointElement("State", "Quantity");
var frame = new StaticLineFrame(); (2)
frame.setLine(GLine.DOT_LINE); (3)
elem.setLineFrame(frame); (4)
graph.addElement(elem);
| 1 | See dataset to use a data block instead of an array literal. |
| 2 | Create the LineFrame object. |
| 3 | Use setLine to assign the dotted line style to the StaticLineFrame. |
| 4 | Use GraphElement.setLineFrame(frame) to add the LineFrame to the PointElement. |

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.
|
|
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:
|
Example 2
This example illustrates how to use bindingInfo properties to control the LineFrame.
-
Bind a Line 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.lineFrame = new StaticLineFrame; Chart1.bindingInfo.lineFrame.line = GLine.LARGE_DASH;
Dashboard script that modifies bindingInfoshould generally be placed in the onRefresh handler. See Add Dashboard Script.