Learning to script graph boxes has a bit of learning curve. You find a pretty good guide in the Scripting Guide (Help > Books > Scripting Guide). There is a section called "Create New Graphs from Scratch" that talks about Graph Box(). The entries for "Custom Graph" and "Graphics" in the Scripting Index (also in the Help menu) has details on things you can do in Graph Box.
As with anything in JSL, there's a million ways to skin this cat in Application Builder, but each way is kinda tricky to figure out. The Scripting Guide will tell you can write something like this:
Graph Box(
Marker(
Marker State( 3 ),
[11 44 77],
[75 25 50]
)
)
The problem here is that when you drag a Graph Box out into your application, you don't have an opportunity to write the graphics script right there. You just have a blank graph. You have to add the graphics script in your application script.
This is where it gets tricky. Graph Box is really a container box for a bunch of display boxes that make up the graph. The graphing area is a Frame Box. You can add a graphics script to the frame box in your script like so:
x = [80 50 20];
y = [20 50 80];
winref = (this module instance << Get Box);
winref[framebox( 1 )] << Add Graphics Script( Marker( x, y ) );
Although, if you look at "Custom Graph" in the Scripting Index, you'll find a bunch of messages you can send to a Graph Box specifically.
For example, you can drag a graph box out into your application and let's say you name it "gb". In the script for that module, I can add points with the following script:
gb << Set Graphics Script( Marker( x, y ) );
//or
gb << Append Seg( Marker Seg(x,y) );
This actually shows you 2 ways to add the points with Append Seg( Marker Seg()) and Set Graphics Script ( Marker()). I prefer the "Set Graphics Script" approach. I attached an example showing all the methods in Application Builder.
As @txnelson pointed out, it's often easier to create this kind of plot in Graph Builder or something similar. In Application Builder, you should see all your open reports at the top of the left pane. You could then drag an existing graph builder report into your application. The only issue here is that it's going to look for those exact column names from the data table when the app launches to populate the Graph Builder plot.
-- Cameron Willden