Choose Language Hide Translation Bar
Highlighted
Samu
Level I

Get Graph Builder from Report Window

Hello everyone,

I have a number of already created graphs - all one graph in a single window.

Now I'm creating a script that goes over all open graph windows and changes some text within the graph.

I got this far:

 

wList = Get Window List(Type("Reports"));

For(w = 1, w <= nitems(wList), w++,
	Print(wList[w] << Get Window Title());
	wList[w] << SendToReport( [...]

Basicially, once I have the window, I'd like to access the Graph Builder and the SendToReport functionality.

Needless to say, a Window isn't the same thing as a Graph Builder, so this isn't working. How do I get from having the window to having the Graph Builder?

I'm imagining something along the lines of wList[w] << Get Graph Builder << SendToReport()


I also realize that this would be a lot easier to do in the script that actually created those graphs, but for various reasons that solution will only be implemented in the future and right now I'm unable to do it that way and will have to work with the finished graphs.

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Get Graph Builder from Report Window

You are close......here is an example of how to do what you want.  You will just have to use the various messages for the different objects within the output windows.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/blood pressure.jmp" );

Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :Dose ), Y( :BP 8M ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :Dose ), Y( :BP 12M ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

wList = Get Window List( Type( "Reports" ) );

wList[1][axisbox( 2 )] << Max( 250 );
Jim

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: Get Graph Builder from Report Window

You are close......here is an example of how to do what you want.  You will just have to use the various messages for the different objects within the output windows.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/blood pressure.jmp" );

Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :Dose ), Y( :BP 8M ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :Dose ), Y( :BP 12M ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

wList = Get Window List( Type( "Reports" ) );

wList[1][axisbox( 2 )] << Max( 250 );
Jim

View solution in original post

Highlighted
Samu
Level I

Re: Get Graph Builder from Report Window

Thank you! Exactly what I needed.

 

For reference, in case someone wants to do the same:

wList[w][ScaleBox(n)] << Label Row() lets you manipulate axis labels.

wList[w][TextEditBox(n)] << Set Text() lets you change the head title, as well as axis titles.

wList[w][FrameBox(n)] << DispatchSeg(TextSeg( m ), {Set Text()} lets you change text boxes inside the graph, like Median or N.

 

Curiously, for some of the changes to actually get displayed (those set by Label Row and DispatchSeg) you need to make a Get Text request afterwards, like for example: Print(wList[w][ScaleBox(1)] << Get Text);

Likely because that's not the best way to go about those text changes, but that way you can use code as in Graph Builder.

Article Labels

    There are no labels assigned to this post.