cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
psundar6
Level III

Add reference line with different values for each chart in a Variability Plot and save in interactive html

Hi,

 

I am trying to create an interactive html of a variability plot graph with multiple charts in the same plot ( by(:<variable>)) and add unique reference lines with different values for each of the individual charts. Is there anyway we can achieve this with JSL? Currently I can plot and save as interactive html with JSL but unable to tailor the reference line values based on the value of the "by" parameter in the Var plot. 

 

-Prithvee

1 REPLY 1
gzmorgan0
Super User (Alumni)

Re: Add reference line with different values for each chart in a Variability Plot and save in interactive html

@psundar6,

 

Your request lacked specific details. Are you having a probem with the sccript or syntax not working, or are you not familiar with customizing graphs via JSL. The simplest method to learn syntax is to customize a simple plot via the JMP UI, then save the script and study the syntax looking up the specific commands in the Scriptng Index or the Scripting Guide. If you are unaware of the JMP report hierarchical display box structure, the script below might not make sense to you.  If you provide more details of what is causing problems, the community can share their best references to learn more.

 

Here is an example script followed by a screen shot of the Interactive HTML page.

 

Names Default To Here( 1 );

dt = Open( "$Sample_Data/Big Class.jmp" );

//find the min max and mean of weight by sex

Summarize( grp = By( :sex ), xb = Mean( :weight ), mx = Maximum( :weight ), mn = Minimum( :weight ) );

//xb, mx and mn are vectors with 2 values.  The order of By in Summarize is the order Var Chart By

vc = dt << Variability Chart(
	Y( :weight ),
	X( :age ),
	Connect Cell Means( 1 ),
	Std Dev Chart( 0 ),
	By( :sex )
);

//error check - do nothings if not matched
If( N Items( vc ) == N Row( xb ),
	For( i = 1, i <= N Items( vc ), i++,
		Report( vc[i] )[Framebox( 1 )] << DispatchSeg( CustomStreamSeg( 3 ), {Line Width( 2 )} );
		Report( vc[i] )[AxisBox( 1 )] << {Add Ref Line( mx[i], "Dotted", "Medium Dark Red", "max", 2 ),
		Add Ref Line( xb[i], "Solid", "Black", "mean", 3 ), Add Ref Line(
			mn[i],
			"Dotted",
			"Medium Dark Red",
			"min",
			2
		)};
	)
);

(vc[1] << Top Parent) << Save Interactive HTML( "C:/temp/CustomVCLimits.htm" );

image.png