cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
] />

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
SpannerHead
Level VI

Automatically Add Reference Lines to Graph Builder

I have a graph created by graph builder and a column in the data contains a constant value that I'd like to automatically add as a reference line to the graph.  Adding the column to the plot axis gives me something (green vertical below) but it's not great looking, any better ideas? 

 

SpannerHead_0-1777923121481.png

 


Slán



SpannerHead
1 REPLY 1
txnelson
Super User

Re: Automatically Add Reference Lines to Graph Builder

Here is a simple example that draws a reference line based upon the value of row 1 from column Weight

txnelson_0-1777928150565.png


Graph Builder(
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Smoother( X, Y, Legend( 7 ) ) ),
	SendToReport(
		Dispatch( {}, {:weight}, ScaleBox,
			{Add Ref Line( 95, "Solid", "Red", "", 1 )}
		),
		Dispatch( {}, "Graph Builder", FrameBox,
			{Add Graphics Script(
				2,
				Description( "" ),
				rp = Current Report();
				rp[axis box( 1 )] << add ref line( :weight[1], "solid", red );
			)}
		)
	)
);

I produced the complete JSL by right clicking on the graph and selecting Customize.  Then clicking on the "+" and writing the simple script

rp=current report();
rp[axis box(1)] << add ref line(:weight[1],"solid",red)

txnelson_1-1777928331410.png

After applying the little script, I went back to the red triangle in the graph, and saved the script to a script window.

Jim

Recommended Articles