Two terms
- platform object: the logic behind graph builder. It is not visible.
- report surface display box tree: the output from graph builder. A visible graph, sliders, buttons.
Mark is correct; the dispatch syntax was created for machines, not humans. The Dispatch message contains information the platform object uses to find a display box in the report. If you need to use it, the SendToReport dispatches must be sent like this:
dt = Open( "$sample_data/big class.jmp" );
gb = dt << Graph Builder(
Size( 512, 442 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
// SendToReport(
// Dispatch( {}, "weight", ScaleBox, {Scale( "Log" ), Format( "Best", 6 ), Min( 60 ), Max( 200 ), Inc( 1 ), Minor Ticks( 1 )} ),
// Dispatch( {}, "height", ScaleBox, {Format( "Engineering", 12 )} )
// )
);
newFormat = {"Percent", "Engineering", "Best"};
newScale = {"Linear", "Log", "Linear"};
newInc = {10, 1, 20};
For( i = 1, i <= N Items( newFormat ), i += 1,
Wait( 1 ); // wait only needed for the demo!
gb << Dispatch( {}, "weight", ScaleBox, {Scale( newScale[i] ), Format( "Best", 6 ),
Min( 60 ), Max( 200 ), Inc( newInc[i] ), Minor Ticks( 0 )} );
gb << Dispatch( {}, "height", ScaleBox, {Format( newFormat[i], 12 )} );
);
gb is the platform object that the <<Dispatch message is sent to. Don't send the <<Dispatch message to the report surface. SendToReport(...) is telling the platform object to dispatch messages into the report tree.
Mark suggests using
gb rep = gb << Report;
gb rep[AxisBox(2)] << Format( Engineering, 12 );
In all of the above, gb is the graph builder platform object. In Mark's example, gb rep is the display box report tree that belongs to the graph builder platform object. Sending the <<report message to the gb platform object retrieves the root of the display box tree (the report surface, the visible part). Subscripting the root returns a more specific subtree of the display box tree:
gb rep[AxisBox(2)]
That's what Mark wants to send the Format message to. One way to get that subscript is using Show Tree Structure.
Show Tree Structure: right-click on the open-close triangle.
The report and the tree structure windows are linked; I clicked on the height axis. The height axis and its info in the tree structure both high-lighted. AxisBox(2) is the second axis box in the report.
Craige