cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
Neo
Neo
Level VI

How to set a Reference Line on each page with Page option in Graph Builder?

The following script plots some charts with the page option in graph builder? How to I set a horizontal reference line, for each chart, say at Weight = 80Kg and label it (80kg) using JSL?

(I need the reference line to remain even if there is a change in the number of charts plotted)

Names Default To Here(1); 
dt = open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Size(528, 2954),
	Show Control Panel(0),
	Variables(X(:height), Y(:weight), Page(:age)),
	Elements(Points(X, Y, Legend(15)), Smoother(X, Y, Legend(16)))
);
When it's too good to be true, it's neither
10 REPLIES 10
jthi
Super User

Re: How to set a Reference Line on each page with Page option in Graph Builder?

And graphic script might be an option

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


gb = dt << Graph Builder(
	Size(528, 984),
	Show Control Panel(0),
	Variables(X(:height), Y(:weight), Page(:age)),
	Elements(
		Points(X, Y(1), Legend(15)),
		Smoother(X, Y(1), Legend(16))
	)
);

(Report(gb) << XPath("//FrameBox")) << Add Graphics Script(
	Pen Color("Red");
	Text Color("red");
	Text(Right Justified, {X Origin() + X Range(), 80}, "Reference");
	H Line(80);
);


gb << Local Data Filter(
	Add Filter(
		columns(:age),
		Display(:age, N Items(6))
	)
);

Write();
-Jarmo