cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
hogi
Level XI

How to send messages to an already existing local data filter inside a graph builder window

Is it possible to send messages to a local data filter inside a graphbuilder object?

Unfortunately, it's not possible to define a varaible "ldf" inside the graphbuilder code - to send the messages to "ldf".

Do I have to "pipe" the message "through the gb object"?

 

 

View more...
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Graph Builder(
	Size( 534, 464 ),
	Show Control Panel( 0 ),
	Graph Spacing( 5 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 5 ) ), Smoother( X, Y, Legend( 6 ) ) ),
	Local Data Filter( Add Filter( columns( :sex ), Where( :sex == "F" ) ) )
);

df = dt << Data Filter(
	Location( {696, 15} ),
	Mode( Include( 1 ) ),
	Add Filter( columns( :sex ), Where( :sex == "F" ) )
);
ldf = (report(gb) << Parent)["Local Data Filter"];

df << Clear ();
//same for ldf: ldf[buttonBox(1)] << click(); df << Add Filter( columns( :name) );
// same for ldf?
2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: Ho to send messages to a local data filter inside a graph builder window

You could add local data filter after graph builder has been created, this will let you have a reference

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Size(534, 464),
	Show Control Panel(0),
	Graph Spacing(5),
	Variables(X(:weight), Y(:height)),
	Elements(Points(X, Y, Legend(5)), Smoother(X, Y, Legend(6)))
);

ldf = gb << Local Data Filter(Add Filter(columns(:sex), Where(:sex == "F")));
wait(1);
ldf << Clear();
ldf << Add Filter( columns( :name) );// same for ldf?
-Jarmo

View solution in original post

txnelson
Super User

Re: Ho to send messages to a local data filter inside a graph builder window

ldf = current report()["Local Data Filter"]<<get scriptable object;
Jim

View solution in original post

6 REPLIES 6
jthi
Super User

Re: Ho to send messages to a local data filter inside a graph builder window

You could add local data filter after graph builder has been created, this will let you have a reference

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Size(534, 464),
	Show Control Panel(0),
	Graph Spacing(5),
	Variables(X(:weight), Y(:height)),
	Elements(Points(X, Y, Legend(5)), Smoother(X, Y, Legend(6)))
);

ldf = gb << Local Data Filter(Add Filter(columns(:sex), Where(:sex == "F")));
wait(1);
ldf << Clear();
ldf << Add Filter( columns( :name) );// same for ldf?
-Jarmo
hogi
Level XI

Re: Ho to send messages to a local data filter inside a graph builder window

Oh, sure.
Like always:

enter the room through another door - and the wall is gone.

Thanks Jarmo.

 

 

txnelson
Super User

Re: Ho to send messages to a local data filter inside a graph builder window

Here is an example taken from the Scripting Index

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Time Series/Air.jmp" );
gb = dt << Graph Builder(
	Size( 522, 492 ),
	Show Control Panel( 0 ),
	Variables(
		X( :month ),
		Y( :Ozone Concentration ),
		Group X( :Summer Months Intervention )
	),
	Elements( Points( X, Y, Legend( 10 ) ), Smoother( X, Y, Legend( 11 ) ) ), 

);
ldf = gb << Local Data Filter(
	Add Filter( columns( :date ), Where( :date >= 16Oct1965 & :date <= 31Aug1968 ) )
);
fc = ldf << Get Filter Column( :date );
fc << Zoom to Selection;
Wait( 1 );
fc << Reset Zoom;
Jim
hogi
Level XI

Re: Ho to send messages to a local data filter inside a graph builder window

And if the Graph is already there and I want to get the settings of the (existing) local data filter?

Any chance?

txnelson
Super User

Re: Ho to send messages to a local data filter inside a graph builder window

ldf = current report()["Local Data Filter"]<<get scriptable object;
Jim
hogi
Level XI

Re: Ho to send messages to a local data filter inside a graph builder window

Ah, via the report layer!
thanks.

 

<<get scriptable object;

is the best invention!