How to use Filter Change Handler to work with Page option in Graph Builder?Attached is an example data table. The script below tries to plot each parameter selected via the Local Data Filter in a new "Page" in Graph Builder. As it stands, the y-axis title is shown as "Median" every time a new "Parameter" is selected via the Local Data Filter.
I would like the Parameter name to be the y-axis title when new a parameter gets selected and plotted on a new "Page".
I tried using the filter change handler for this, but my script does not quite work. I think I need the index i below to be updated each time a new parameter is selected or may be there is another way. Any direction will be useful.
XPath( "//TextEditBox" ))[i]
here is my script
Names Default To Here (1);
Clear Log ();
gb = Graph Builder(
Size( 531, 325 ),
Show Control Panel( 0 ),
Variables( X( :PartID ), Y( :Median ), Page( :Parameter ), Color( :TestStage ) ),
Elements( Points( X, Y, Legend( 34 ) ) ),
Local Data Filter(
Conditional,
Add Filter(
columns( :TestStage, :Parameter ),
Where( :TestStage == {"A", "B"} ),
Where( :Parameter == {"BKDVoltage", "Capacitance"} )
)
),
SendToReport( Dispatch( {}, "graph title", TextEditBox, {Set Text( "myTitleGoesHere" )} ) )
);
ldf = Current Report()["Local Data Filter"] << get scriptable object;
changeTitle = Function( {this},
print(this);
ldfText = Regex(ldf << get where clause(),"\(?\s*(:Parameter == .*?)\)","\1");
if(ismissing(ldfText),ldfText = " Selected Test Parameter ");
(Report( gb ) << XPath( "//TextEditBox" ))[6] << Set Text(ldfText);
);
fsh = ldf << Make Filter Change Handler(changeTitle());Automation and ScriptingWindowsRe: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi Thanks. Upon initial checking, your first script works as expected (even with all unchecked). It gives expected y-axis title in all cases. Second script does not show the correct y-axis title in any case (always shows Median as the y-axis title).
I will spend some more time with the two scripts and come back if I have questions.
Re: How to use Filter Change Handler to work with Page option in Graph Builder?What is returned can be a bit finicky in my experience (especially when nothing/everything is selected). Next you would have to figure out what to do in those situations and then you should be able to modify my earlier script.
Below are few solutions to this whole thing which do work for me, not sure if the "simpler" one does work in JMP16. I wouldn't suggest looking into these until you have managed to figure out what you could do int the "Empty" situation so you understand what type of issues there could be.
View more...Names Default To Here(1);
dt = Open("$DOWNLOADS/exampleSummaryTableNoLimsNew.jmp");
gb = dt << Graph Builder(
Size( 571, 174 ),
Show Control Panel(0),
Variables(X(:PartID), Y(:Median), Page(:Parameter), Color(:TestStage)),
Elements(Points(X, Y, Legend(34))),
SendToReport(Dispatch({}, "graph title", TextEditBox, {Set Text("Trend Chart")}))
);
filter_ref = gb << Local Data Filter(
Conditional,
Add Filter(
columns(:TestDate, :Has Limits?, :TestStage, :Parameter),
Where( :Has Limits? == "Yes" ),
Where( :TestStage == "STG5" ),
)
);
Summarize(dt, all_params = By(:Parameter));
filter_ref = (Report(gb) << top parent)[OutlineBox("Local Data Filter")] << Get Scriptable Object;
update_title = Function({this},
cur_rows = filter_ref << Get Filtered Rows;
If(!Is Empty(cur_rows),
visible_parameters = Associative Array(dt[cur_rows, "Parameter"]) << get keys;
, // else, this wasn't solved
visible_parameters = all_params;
);
tebs = Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox");
y_tebs = tebs[4 :: N Items(tebs) :: 2]; // skip title, subtitle and xaxis?
If(N Items(y_tebs) != N Items(visible_parameters),
Return(0); // some problem
);
gb << inval;
For Each({param_val, idx}, visible_parameters, y_tebs[idx] << Set Text(param_val));
gb << update window;
Return(1);
);
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
update_title(local_filter);
filter_handler = local_filter << Make Filter Change Handler(update_title());
Names Default To Here(1);
dt = Open("$DOWNLOADS/exampleSummaryTableNoLimsNew.jmp");
gb = dt << Graph Builder(
Size( 571, 174 ),
Show Control Panel(0),
Variables(X(:PartID), Y(:Median), Page(:Parameter), Color(:TestStage)),
Elements(Points(X, Y, Legend(34))),
SendToReport(Dispatch({}, "graph title", TextEditBox, {Set Text("Trend Chart")}))
);
filter_ref = gb << Local Data Filter(
Conditional,
Add Filter(
columns(:TestDate, :Has Limits?, :TestStage, :Parameter),
Where( :Has Limits? == "Yes" ),
Where( :TestStage == "STG5" ),
)
);
Summarize(dt, all_params = By(:Parameter));
filter_ref = (Report(gb) << top parent)[OutlineBox("Local Data Filter")] << Get Scriptable Object;
update_title = Function({this},
gb << inval;
page_texts = Report(gb) << XPath("//GraphBuilderGroupBox/text()"); // Not sure if this can be used in JMP16
tebs = Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox");
y_tebs = tebs[4 :: N Items(tebs) :: 2]; // skip title, subtitle and xaxis?
For Each({page_text, idx}, page_texts,
y_tebs[idx] << Set Text(Word(-1, page_text, "="));
);
gb << update window;
wait(0);
Return(1);
);
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
update_title(local_filter);
filter_handler = local_filter << Make Filter Change Handler(update_title());
Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi Thanks, I thought I had checked by unchecking all, apparently not. I get the same as you.
(Just checked, this issue seems to be there in your previous script as well, i.e. unchecking all does not result in expected output)

Re: How to use Filter Change Handler to work with Page option in Graph Builder?If you didn't do any modifications to my script, there is still one situation which isn't solved

If you go from a single selection to none / clear selections. That should be solved first
Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi I think, I get the same. Please see below.
Is the next task to introduce the function to change the y-axis title on each new page?
(Seems like your previous way of doing this would need to change now)


Re: How to use Filter Change Handler to work with Page option in Graph Builder?If it works with JMP Sample Data then you move to the most simple possible example with your own data
Names Default To Here(1);
dt = Open("$DOWNLOADS/exampleSummaryTableNoLimsNew.jmp");
gb = dt << Graph Builder(
Size( 571, 174 ),
Show Control Panel(0),
Variables(X(:PartID), Y(:Median), Page(:Parameter), Color(:TestStage)),
Elements(Points(X, Y, Legend(34))),
SendToReport(Dispatch({}, "graph title", TextEditBox, {Set Text("Trend Chart")}))
);
filter_ref = gb << Local Data Filter(
Conditional,
Add Filter(
columns(:TestDate, :Has Limits?, :TestStage, :Parameter),
Where( :Has Limits? == "Yes" ),
Where( :TestStage == "STG5" ),
)
);
Summarize(dt, all_params = By(:Parameter));
filter_ref = (Report(gb) << top parent)[OutlineBox("Local Data Filter")] << Get Scriptable Object;
get_selected_parameters = function({a},
cur_rows = filter_ref << Get Filtered Rows;
If(!Is Empty(cur_rows),
visible_parameters = Associative Array(dt[cur_rows, "Parameter"]) << get keys;
Show(N Items(visible_parameters));
,
Show("Empty..."); // Your problem, you should have all states visible here
);
);
get_selected_parameters(1);
f = filter_ref << Make Filter Change Handler(get_selected_parameters);
These counts should always match

Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi Thanks. Your last script works when I run it and results are as expected with JMP Sample Data (true for all your scripts so far). The reason I used my data table is because I thought the data form I have could be causing my issue.
I am afraid, I am a bit lost now with all the different scripts on the table.
Re: How to use Filter Change Handler to work with Page option in Graph Builder?Keep with the simple JMP Sample Data and solve your problems one by one. First you have to define your problems. I skip quite a few problems you have to solve (or have already solved) to get this working and try to get focus on the current issue:
- On top level you want to be able to figure out how to update Y-axis titles based on the Page name
- You have filters which affect which pages are visible
- You can have filter set to all, one, many and none
- All and none are basically the same (all pages are visible) but they need to be managed in separate manner
- How can you handle the these different situations; All, None, One and Many?
- How can you handle these situations inside a function used in filter change hander?
Until you get this issue solved, there is no point moving to the full application you have (if you get stuck, you could solve some separate problem first if you have them). Below is example script, you should be able to get the else statement to always return 41 (or rather full list of states if you remove N Items()).
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
gb = dt << Graph Builder(
Size(630, 590),
Show Control Panel(0),
Include Missing Categories(1),
Variables(X(:State)),
Elements(Treemap(X, Legend(4))),
Local Data Filter(
Conditional,
Add Filter(columns(:Region, :POP), Display(:Region, N Items(6)))
)
);
Summarize(dt, all_states = By(:State));
show(N Items(all_states));
filter_ref = (Report(gb) << top parent)[OutlineBox("Local Data Filter")] << Get Scriptable Object;
get_selected_states = function({a},
cur_rows = filter_ref << Get Filtered Rows;
If(!Is Empty(cur_rows),
visible_states = Associative Array(dt[cur_rows, "State"]) << get keys;
Show(N Items(visible_states));
,
Show("Empty..."); // Your problem, you should have all states visible here
);
);
get_selected_states(1);
f = filter_ref << Make Filter Change Handler(get_selected_states);Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi using my data table exampleSummaryTableNoLimsNew.jmp, the following appears to work as expected (I have manually checked the data table and outputs). How does one proceed from this to my actual problem where the data filter is within the Graph Builder. I find associative arrays very confusing so requesting some help here.
Names Default To Here(1);
clear log ();
dt = Current Data Table();
obj = dt << Data Filter(Conditional,
Add Filter(columns(:TestDate, :Has Limits?, :TestStage, :Parameter) ),
Mode(Select(0), Show(0), Include(1))
);
Summarize(dt, all_Parameters = By(:Parameter));
show(all_Parameters);
// Change filter value at this point and run the code below
cur_rows = obj << Get Filtered Rows;
visible_Parameters = Associative Array(dt[cur_rows, "Parameter"]) << get keys;
Show(N Items(all_Parameters), N Items(visible_Parameters));
Re: How to use Filter Change Handler to work with Page option in Graph Builder?Using data table subscripting is one option
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
obj = dt << Data Filter(
Add Filter(columns(:Region, :POP)),
Mode(Select(0), Show(0), Include(1))
);
Summarize(dt, all_states = By(:State));
show(all_states);
// Change filter value at this point and run the code below
cur_rows = obj << Get Filtered Rows;
visible_states = Associative Array(dt[cur_rows, "State"]) << get keys;
Show(N Items(all_states), N Items(visible_states));Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi Thanks, I tried to see which rows are getting filtered and the script partially works with the data table exampleSummaryTableNoLimsNew.jmp, but not in all filtering cases.
I am trying to select the filtered rows in the data table and manually check if they are correct. Currently I am stuck.
Clearly its my lack of understanding of the code flow which is preventing me to debug further so I would request some more help.
Modified script below (line 28 is where I check with get filtered rows).
Names Default To Here(1);
clear log ();
dt = Current Data Table();
gb = dt << Graph Builder(
Size( 571, 174 ),
Show Control Panel(0),
Variables(X(:PartID), Y(:Median), Page(:Parameter), Color(:TestStage)),
Elements(Points(X, Y, Legend(34))),
SendToReport(Dispatch({}, "graph title", TextEditBox, {Set Text("Trend Chart")}))
);
ldf = gb<<LOCAL data="https://community.jmp.com/" filter=""></LOCAL>Re: How to use Filter Change Handler to work with Page option in Graph Builder?You could just try what it does when you send it to a data filter.
Here is example from JMP17 scripting index
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
obj = dt << Data Filter(
Add Filter(columns(:Region, :POP), where(:Region == {"C", "N"})),
Mode(Select(0), Show(0), Include(1))
);
obj << Get Filtered Rows; // [1, 4, 5, 6, 7, 19, 20, 26, 36, 40, 42, 46]Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi Thanks but my Scripting Index (JMP 16.2) does got give any example on how to use << Get Filtered Rows.
Could I get some help on how to use it in my case?

Re: How to use Filter Change Handler to work with Page option in Graph Builder?This check is causing the issues.

There are more filters which can cause a situation when not all parameters are visible. One option would be to use << Get Filtered Rows and calculate which parameters are visible instead of just assuming all of them are.
Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi In the example cases so far everything works as expected and matches what you see.
However, I was able to reproduce part of the issue I am facing with my actual data by creating another data table which more closely matches with my actual data. Data table is attached and using the script below
Names Default To Here(1);
dt = Current Data Table();
gb = dt << Graph Builder(
Size( 571, 174 ),
Show Control Panel(0),
Variables(X(:PartID), Y(:Median), Page(:Parameter), Color(:TestStage)),
Elements(Points(X, Y, Legend(34))),
Local Data Filter(
Conditional,
Add Filter(
columns(:TestDate, :Has Limits?, :TestStage, :Parameter ),
Where( :Has Limits? == "Yes" ),
Where( :TestStage == "STG5" ),
)
),
SendToReport(Dispatch({}, "graph title", TextEditBox, {Set Text("myTitleGoesHere")}))
);
Summarize(dt, uniq_params = By(:Parameter));
update_title = Function({this},
param_where = Regex(local_filter << get where clause(), "\(?\s*(:Parameter == .*?)\)", "\1");
If(Is Missing(param_where),
param_list = uniq_params,
param_where_list = Words(param_where, "|");
param_list = Transform Each({where_str}, param_where_list,
title = Trim Whitespace(Word(-1, where_str, "="));
Substitute(title, "\!"", "");
);
);
tebs = Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox");
y_tebs = tebs[4 :: N Items(tebs) :: 2]; // skip title, subtitle and xaxis?
If(N Items(y_tebs) != N Items(param_list),
Return(0); // some problem
);
gb << inval;
For Each({param_val, idx}, param_list, y_tebs[idx] << Set Text(param_val));
gb << update window;
Return(1);
);
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
update_title(local_filter);
filter_handler = local_filter << Make Filter Change Handler(update_title());I get the following when no Parameters are selected,

and this one after selecting all Parameters and unselecting them again. Here the top chart only gets the correct y-axis label.

Hopefully if these get resolved, my actual data case will start working as expected as well. Any direction would be very useful.
Re: How to use Filter Change Handler to work with Page option in Graph Builder?Using exampleSummarTable.jmp and latest script I provided.
After one value has been filtered

Deselect that single value (so nothing is being filtered)

Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi I do not understand what you mean by "Does it work if you select one value and then remove all selections from your filter?". Could you please rephrase? Also, I am on JMP 16.2.
Re: How to use Filter Change Handler to work with Page option in Graph Builder?Not sure what could be wrong as it seems to work with the original data and with the data2 after removing multiple response just fine (using JMP17.2). Does it work if you select one value and then remove all selections from your filter?
View more...
Names Default To Here(1);
dt = Current Data Table();
gb = dt << Graph Builder(
Show Control Panel(0),
Variables(X(:PartID), Y(:Median), Page(:Parameter), Color(:TestStage)),
Elements(Points(X, Y, Legend(34))),
Local Data Filter(
Conditional,
Add Filter(
columns(:TestStage, :Parameter),
Where(:TestStage == {"A", "B"})
)
),
SendToReport(Dispatch({}, "graph title", TextEditBox, {Set Text("myTitleGoesHere")}))
);
Summarize(dt, uniq_params = By(:Parameter));
update_title = Function({this},
param_where = Regex(local_filter << get where clause(), "\(?\s*(:Parameter == .*?)\)", "\1");
If(Is Missing(param_where),
param_list = uniq_params,
param_where_list = Words(param_where, "|");
param_list = Transform Each({where_str}, param_where_list,
title = Trim Whitespace(Word(-1, where_str, "="));
Substitute(title, "\!"", "");
);
);
tebs = Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox");
y_tebs = tebs[4 :: N Items(tebs) :: 2]; // skip title, subtitle and xaxis?
If(N Items(y_tebs) != N Items(param_list),
Return(0); // some problem
);
gb << inval;
For Each({param_val, idx}, param_list, y_tebs[idx] << Set Text(param_val));
gb << update window;
Return(1);
);
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
update_title(local_filter);
filter_handler = local_filter << Make Filter Change Handler(update_title());
Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi Thanks. This runs without error in the case of my actual data set but the initial plots are still without the correct parameter names on the y-axis. The correct y-axis titles are trigged only when I select a second TestStage (initially only one is selected via the script).
Re: How to use Filter Change Handler to work with Page option in Graph Builder?Like I said, it is most likely due to parameters being filtered
Names Default To Here (1);
dt = Open("$DOWNLOADS/exampleSummaryTable.jmp");
gb = dt << Graph Builder(
Size( 531, 325 ),
Show Control Panel( 0 ),
Variables( X( :PartID ), Y( :Median ), Page( :Parameter ), Color( :TestStage ) ),
Elements( Points( X, Y, Legend( 34 ) ) ),
Local Data Filter(
Conditional,
Add Filter(
columns( :TestStage, :Parameter ),
Where( :TestStage == {"A", "B"} ),
Where( :Parameter == {"BKDVoltage", "Capacitance"} )
)
),
SendToReport( Dispatch( {}, "graph title", TextEditBox, {Set Text( "myTitleGoesHere" )} ) )
);
Summarize(dt, uniq_params = By(:Parameter));
update_title = Function( {this},
param_where = Regex(local_filter << get where clause(),"\(?\s*(:Parameter == .*?)\)","\1");
If(Is Missing(param_where),
param_list = uniq_params;
,
param_where_list = Words(param_where, "|");
param_list = Transform Each({where_str}, param_where_list,
title = Trim Whitespace(Word(-1, where_str, "="));
Substitute(title, "\!"", "");
);
);
tebs = Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox");
y_tebs= tebs[4::N Items(tebs)::2]; // skip title, subtitle and xaxis?
If(N Items(y_tebs) != N Items(param_list),
return(0); // some problem
);
gb << inval;
For Each({param_val, idx}, param_list,
y_tebs[idx] << Set Text(param_val);
);
gb << update window;
return(1);
);
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
update_title(local_filter);
filter_handler = local_filter << Make Filter Change Handler(update_title());
Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi In the actual data case, if I comment out
update_title(local_filter);
as in
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
//update_title(local_filter);
filter_handler = local_filter << Make Filter Change Handler(update_title());
Everything works as expected except the initial charts do not have the correct Y Axis title. Y axis title becomes correct only after another TestStage is selected. Is my placement of
update_title(local_filter);
correct or should it be placed somewhere else?
Re: How to use Filter Change Handler to work with Page option in Graph Builder?This isn't returning what it is supposed to
param_where = Regex(local_filter << get where clause(),"\(?\s*(:Parameter == .*?)\)","\1");
One reason could be that you have no values selected in local data filter. You could add additional check for missing values and if param_where is missing, return early from the function without doing nothing (or rather then you have all values as parameters and you have to get the parameter values some other way)
Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi Thanks, Removing Multiple Response from Parameter properties does make the script work for the example data (exampleSummaryTable2). But I am still having problems with my actual data set where there are no columns with Multiple Response set (unfortunately cannot share actual data). What else could it be?

I can also reproduce this same error if I use comment out this in the script
//Where( :Parameter == {"BKDVoltage_1", "Capacitance_1"}as in
Names Default To Here (1);
clear log ();
dt = Current Data Table();
gb = dt << Graph Builder(
Size( 531, 525 ),
Show Control Panel( 0 ),
Variables( X( :PartID ), Y( :Median ), Page( :Parameter ), Color( :TestStage ) ),
Elements( Points( X, Y, Legend( 34 ) ) ),
Local Data Filter(
Conditional,
Add Filter(
columns( :TestStage, :Parameter ),
Where( :TestStage == {"A", "B"} ),
//Where( :Parameter == {"BKDVoltage_1", "Capacitance_1"} )
)
),
SendToReport( Dispatch( {}, "graph title", TextEditBox, {Set Text( "myTitleGoesHere" )} ) )
);
update_title = Function( {this},
param_where = Regex(local_filter << get where clause(),"\(?\s*(:Parameter == .*?)\)","\1");
param_where_list = Words(param_where, "|");
tebs = Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox");
y_tebs= tebs[4::N Items(tebs)::2]; //show (y_tebs);
If(N Items(y_tebs) != N Items(param_where_list),
return();
);
For Each({where_str, idx}, param_where_list,
title = Trim Whitespace(Word(-1, where_str, "="));
Substitute Into(title, "\!"", "");
y_tebs[idx] << Set Text(title);
);
);
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
update_title(local_filter);
filter_handler = local_filter << Make Filter Change Handler(update_title());In my actual data case, I do not have the luxury to pre-select one or more parameters via the Local Data Filter. Perhaps this is what is causing the issue in the actual data case. Any way to get around this?
Re: How to use Filter Change Handler to work with Page option in Graph Builder?Issue is most likely that you have Multiple Response column as you Parameter


Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi Ok. Noted the trigger. The script does not work if I have an underscore in my Parameter name (I have got few underscores in the parameters names in my actual data). Example data table attached with underscore in Parameter name. The script below throws an error on the Words function with the attached data table.
Also had to comment the Size() without which the initial charts looked strange.
Names Default To Here (1);
clear log ();
dt = Current Data Table();
gb = dt << Graph Builder(
//Size( 531, 525 ),
Show Control Panel( 0 ),
Variables( X( :PartID ), Y( :Median ), Page( :Parameter ), Color( :TestStage ) ),
Elements( Points( X, Y, Legend( 34 ) ) ),
Local Data Filter(
Conditional,
Add Filter(
columns( :TestStage, :Parameter ),
Where( :TestStage == {"A", "B"} ),
Where( :Parameter == {"BKDVoltage_1", "Capacitance_1"} )
)
),
SendToReport( Dispatch( {}, "graph title", TextEditBox, {Set Text( "myTitleGoesHere" )} ) )
);
update_title = Function( {this},
param_where = Regex(local_filter << get where clause(),"\(?\s*(:Parameter == .*?)\)","\1");
param_where_list = Words(param_where, "|");
tebs = Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox");
y_tebs= tebs[4::N Items(tebs)::2];
If(N Items(y_tebs) != N Items(param_where_list),
return();
);
For Each({where_str, idx}, param_where_list,
title = Trim Whitespace(Word(-1, where_str, "="));
Substitute Into(title, "\!"", "");
y_tebs[idx] << Set Text(title);
);
);
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
update_title(local_filter);
filter_handler = local_filter << Make Filter Change Handler(update_title());Re: How to use Filter Change Handler to work with Page option in Graph Builder?Trigger the function once before you create the filter change handler
update_title(local_filter);

Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi This works except the initial chart (before filter change handler kids in) still has Median as y-axis title. Any way to fix this?

Re: How to use Filter Change Handler to work with Page option in Graph Builder?One option would be to parse the get where clause
ldfText = Regex(ldf << get where clause(),"\(?\s*(:Parameter == .*?)\)","\1");
into separate items and loop over those and set the titles in the loop.
Edit:
This will require a bit modification also to the part where you get references to text edit boxes for y-axis. Below is one option which might work
Names Default To Here (1);
dt = Open("$DOWNLOADS/exampleSummaryTable.jmp");
gb = dt << Graph Builder(
Size( 531, 325 ),
Show Control Panel( 0 ),
Variables( X( :PartID ), Y( :Median ), Page( :Parameter ), Color( :TestStage ) ),
Elements( Points( X, Y, Legend( 34 ) ) ),
Local Data Filter(
Conditional,
Add Filter(
columns( :TestStage, :Parameter ),
Where( :TestStage == {"A", "B"} ),
Where( :Parameter == {"BKDVoltage", "Capacitance"} )
)
),
SendToReport( Dispatch( {}, "graph title", TextEditBox, {Set Text( "myTitleGoesHere" )} ) )
);
update_title = Function( {this},
param_where = Regex(local_filter << get where clause(),"\(?\s*(:Parameter == .*?)\)","\1");
param_where_list = Words(param_where, "|");
tebs = Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox");
y_tebs= tebs[4::N Items(tebs)::2];
If(N Items(y_tebs) != N Items(param_where_list),
return(); // some problem
);
For Each({where_str, idx}, param_where_list,
title = Trim Whitespace(Word(-1, where_str, "="));
Substitute Into(title, "\!"", "");
y_tebs[idx] << Set Text(title);
);
);
local_filter = Current Report()["Local Data Filter"] << get scriptable object;
filter_handler = local_filter << Make Filter Change Handler(update_title());
Re: How to use Filter Change Handler to work with Page option in Graph Builder?@jthi This partly works, but all selected Parameters are appearing as Y-axis title in all the plotted charts under each other.
I changed
(Report( gb ) << XPath( "//TextEditBox" ))[6] << Set Text(ldfText);
to
(Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox[text()='Median']")) << Set Text(ldfText);and get

Need only the plotted Parameter name as Y-axis title on each chart.
Re: How to use Filter Change Handler to work with Page option in Graph Builder?You could try to make your XPath query more accurate (explore the XML and property tree). Something like this might work
Report(gb) << XPath("//GraphBuilderTitleBox/TextEditBox[text()='Median']")