cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
AlexanderKrebs
Level II

JSL How to Dispatch a message to a specific variability chart in SendToReport?

Hello,

 

I am receiving dozens of warnings in the log file which seem to come from Dispatch not being addressed as desired. I use JMP 16.0.0. Here is an example to illustrate the issue. My real application is more complex with several individual Dispatch commands to the charts.

 

dt = Open("$SAMPLE_DATA\Big Class.jmp");
dt:age << SetModelingType("Continuous");

dt << VariabilityChart(
  X(:sex),
  Y(:age, :height, :weight),
  SendToReport(
    Dispatch(
    {},
    "Variability Chart for age",
    OutlineBox,
    {SetTitle("My Indiviual Variability Chart Title")}
    )
  )
);

The code generates (a list of) 3 Variability Charts. I try to set the title of the "age" chart only. Setting the title works fine. But I get the following 2 warnings in the log.

 

 

Cannot find OutlineBox[ "Variability Chart for age" ] at {}
Cannot find OutlineBox[ "Variability Chart for age" ] at {}
{Variability Chart[], Variability Chart[], Variability Chart[]}

It appears like the message is dispatched to all three charts. And the outline box with name "Variability Chart for age" is not found in the "height" and the "weight" charts, of course.

 

How can I ensure the message is dispatched to the "age" chart only?

 

Thanks,

Alex.

 

 

4 REPLIES 4
jthi
Super User

Re: JSL How to Dispatch a message to a specific variability chart in SendToReport?

In JMP17 you won't get those "errors", but it seems like in JMP16 you do. It would be better to set the titles on report layer, for example with something like this:

Names Default To Here(1);

dt = Open("$SAMPLE_DATA\Big Class.jmp");
Column(dt, "age") << SetModelingType("Continuous");

var = dt << VariabilityChart(X(:sex), Y(:age, :height, :weight));
wait(2);
Report(var)[OutlineBox("Variability Chart for age")] << Set Title("My Individual Variability Chart Title");
-Jarmo
AlexanderKrebs
Level II

Re: JSL How to Dispatch a message to a specific variability chart in SendToReport?

Does your code work in JMP 17? It fails in JMP 16.

 

I would need to use

Report(var[1])[OutlineBox("Variability Chart for age")] << Set Title("My Individual Variability Chart Title");

to select the 1st element of the var list. Correct?

 

Anyway, thanks. This is pointing me into the right direction.

 

jthi
Super User

Re: JSL How to Dispatch a message to a specific variability chart in SendToReport?

Seems like it doesn't work with JMP16. I would avoid using just the index if can and rather use some other method to get the correct reference. Maybe looping over the list of charts and finding the correct one or using XPath to get correct element references.

-Jarmo
lala
Level VIII

Re: JSL How to Dispatch a message to a specific variability chart in SendToReport?

Thanks!