Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
matth1
Level II

Dispatching command to nested chart

Apologies if there's an answer to this already...

 

I am creating a contour plot and want to add a circle to the plot using a script. When the plot is a standalone window it's easy, I add something like this:

 

SendToReport(
		Dispatch(
			{},
			"Contour Plot Graph",
			FrameBox,
			{Add Graphics Script( 2, Description( "Script" ), Circle( {0, 0}, 3 ) )}
		)

However, I am including the plot in a larger report containing other charts. To do this, I have an outline box, containing several HListBox and VListBox instances. When I do that, I can no longer get the dispatch command to reach the contour plot. Instead I get an warning like: 

 

Cannot find FrameBox[ "Contour Plot Graph" ] at {}

The tree structure looks like this:

 

matth1_0-1582198880969.png

 

I've tried all sorts of combinations in the first argument of Dispatch and I can't work it out, so I'd be very grateful for some help!

 

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Dispatching command to nested chart

Don't use Dispatch().

 

Send a message directly to the appropriate display box, the Frame Box in this case. Assuming that your window reference is stored in a variable window, try this:

 

window[OutlineBox("Contour Plot for x"][FrameBox(1)] << Add Graphics Script( 2, Description( "Script" ), Circle( {0, 0}, 3 ) );
Learn it once, use it forever!

View solution in original post

1 REPLY 1
Highlighted

Re: Dispatching command to nested chart

Don't use Dispatch().

 

Send a message directly to the appropriate display box, the Frame Box in this case. Assuming that your window reference is stored in a variable window, try this:

 

window[OutlineBox("Contour Plot for x"][FrameBox(1)] << Add Graphics Script( 2, Description( "Script" ), Circle( {0, 0}, 3 ) );
Learn it once, use it forever!

View solution in original post

Article Labels

    There are no labels assigned to this post.