StaticTextureFrame
The StaticTextureFrame object contains a texture frame defined by explicit texture data in the VisualFrame.setField(field) column, or by the fixed texture in StaticTextureFrame.setTexture(value). To create a StaticTextureFrame object, call the StaticTextureFrame constructor.
var frame = new StaticTextureFrame(); (1)
var frame = new StaticTextureFrame(GTexture.PATTERN_5); (2)
| 1 | Call constructor without specifying a texture. |
| 2 | Call constructor and pass the specified texture. |
You can pass a GTexture object directly to the constructor or specify it later using the StaticTextureFrame.setTexture(value) function. You can also assign a TextureFrame using the bindingInfo.textureFrame property in onRefresh script. See Example 2 below.
Example 1
dataset = [["State","Quantity","Texture"],["NJ",200,1], ["NY",300,10]]; (1)
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var frame = new StaticTextureFrame(); (2)
frame.setField("Texture");
elem.setTextureFrame(frame); (3)
graph.addElement(elem);
| 1 | See dataset to use a data block instead of an array literal. |
| 2 | Create the StaticTextureFrame object. |
| 3 | Use GraphElement.setTextureFrame(frame) to add the TextureFrame 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.
|
|
To change the property on a Chart that was previously created with the Chart Editor, use “getter” methods such as EGraph.getElement(index) ① and GraphElement.getTextureFrame() ② to obtain a handle to the desired GraphElement and TextureFrame objects. For example:
|
Example 2
This example illustrates how to use bindingInfo properties to control the TextureFrame.
-
Bind a Bar 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.setShapeField("Total",Chart.NUMBER); Chart1.bindingInfo.textureFrame = new StaticTextureFrame;
Dashboard script that modifies bindingInfoshould generally be placed in the onRefresh handler. See Add Dashboard Script.