<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Dispatch to dynamically generated piled charts in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38450#M22508</link>
    <description>&lt;P&gt;It would be a lot easier to help youif you can provide us with code that we can run. &amp;nbsp;Which means either providing the table 'summary.jmp' or rewriting the code to work with one of the sample data tables that come with JMP. &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2017 15:12:51 GMT</pubDate>
    <dc:creator>David_Burnham</dc:creator>
    <dc:date>2017-04-24T15:12:51Z</dc:date>
    <item>
      <title>Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38449#M22507</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I try to generate a report in which I have 2 charts per "parameter" for median and stdev, and I'm struggling adding lines in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "Summary.jmp" file contains multiple columns with a "Lot" (I use it as the X axis), and then several parameters, each of them having a column for median with suffix "_Q50" and one with suffix "_StdDev".&lt;/P&gt;
&lt;P&gt;I have a list of parameters that have in addition Target, LowerSpecsLimit and UpperSpecsLimits (TGT, LSL, USL). I don't have them directly in the columns as they can change based on the "Lot" set I select and I would actually prefer not touching the file at all, to make sure I don't leave a mess behind if the script fails for whatever reason.&lt;/P&gt;
&lt;P&gt;I also have Dispatch to replace the titles and axes labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I then have a function that generates the median and stdev charts on top of each other, charts are fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But no matter what I put in the dispatch section, I get an error&lt;/P&gt;
&lt;P&gt;"Cannot find ScaleBox ... at {}"&lt;/P&gt;
&lt;P&gt;and all the TextEditor dispatch seem to do nothing (not even an error, but I assume the function stops at the first dispatch error?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I generated the charts and made manual modification to check the resulting script, and it didn't help. It uses "Param1_Q50" directly, and even that does not work when I put it back in the script!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

Open("Summary.jmp");

GraphXSize = 800;
GraphYSize = 600;

ParamsList = {
	{"Param1", "Name1", 0, -10, 10},
	{"Param2", "Name2", 50, 25, 75}
};

ParamGraph = Function (
	{parameter, title, tgt=".", lsl=".", usl="."},
	LOCAL(
		{Default Local},
		medianCol = parameter || "_Q50";
		stdevCol = parameter || "_StdDev";
		gb = Graph Builder(
			Size(GraphXSize,GraphYSize),
			Show Control Panel(0),
			Show Footer(0),
			Show Legend(0),
			Variables(
				X(:Name("Lot")),
				Y(Column(medianCol)),
				Y(Column(stdevCol)),
				Color(:Lot)
			),
			Elements(
				Points(X, Y, Legend(6))	
			),
			SendToReport(
				Dispatch(
					{},
					medianCol,
					ScaleBox,
					{IF(tgt != ".", Add Ref Line(tgt, "Solid", "Black", "TARGET", 1)),
					IF(lsl != ".", Add Ref Line(lsl, "Solid", "Purple", "LSL", 1)),
					IF(usl != ".", Add Ref Line(usl, "Solid", "Red", "USL", 1))}
				),
				Dispatch({}, "graph title", TextEditor, {Set Text(title)}),
				Dispatch({}, "Y title", TextEditor, {Set Text("Median")}),
				Dispatch({}, "Y 1 title", TextEditor, {Set Text("Std Dev")})
			),
		);
	);
);
	

New Window("Summary - Report", 
	For(i=1, i&amp;lt;=Length(ParamsList), i++,
		ParamGraph(ParamsList[i][1], ParamsList[i][2], ParamsList[i][3], ParamsList[i][4], ParamsList[i][5])
	)
) &amp;lt;&amp;lt; Set Window Icon("Trellis")&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I even tried to replace medianCol in the Dispatch section with "Param1_Q50", to see if that was a substitution issue, expecting the first chart would get the lines and not the others, but... it didn't work!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tried getting reference to the report&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rgb = gb &amp;lt;&amp;lt; report;
rgb[TextEditBox(5)] &amp;lt;&amp;lt; Set Text("Median");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I get an error message again:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Cannot subscript Display Box in access or evaluation of 'Subscript' , rgb[/*###*/"TextEditor"]&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know how I can address the elements of these charts??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 14:54:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38449#M22507</guid>
      <dc:creator>matlag</dc:creator>
      <dc:date>2017-04-24T14:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38450#M22508</link>
      <description>&lt;P&gt;It would be a lot easier to help youif you can provide us with code that we can run. &amp;nbsp;Which means either providing the table 'summary.jmp' or rewriting the code to work with one of the sample data tables that come with JMP. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 15:12:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38450#M22508</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2017-04-24T15:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38451#M22509</link>
      <description>&lt;P&gt;You have a mismatch in data types for your limits. &amp;nbsp;The "Add Ref Line" requires that the line value(first value) needs to be a numeric value. &amp;nbsp;In your function, you are setting it to a character string. &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ParamGraph = Function( {parameter, title, tgt = ".", lsl = ".", usl = "."}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and in your If statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( tgt != ".",&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The element list needs to be changed to numeric&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ParamGraph = Function( {parameter, title, tgt = ".", lsl = ., usl = .}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the If statement needs to be changed to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( IsMissing(tgt) == 0,&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Apr 2017 15:21:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38451#M22509</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-04-24T15:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38452#M22510</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a summary.jmp.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 15:21:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38452#M22510</guid>
      <dc:creator>matlag</dc:creator>
      <dc:date>2017-04-24T15:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38454#M22512</link>
      <description>&lt;P&gt;Thanks - looks like Jim has you covered&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 16:07:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38454#M22512</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2017-04-24T16:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38455#M22513</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks! I did the correction, but it didn't fix my issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cannot find ScaleBox["medianCol"] at {}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or if I hard code it":&lt;/P&gt;
&lt;P&gt;Cannot find ScaleBox["Param1_Q50"] at {}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that if I remove the second Y axis chart, then suddenly the ref lines work, but not titles and axes renaming.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 16:20:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38455#M22513</guid>
      <dc:creator>matlag</dc:creator>
      <dc:date>2017-04-24T16:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38464#M22516</link>
      <description>&lt;P&gt;After a lot of try and fails, I managed to do it (not very intuitive!)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I didn't use SendToReport, but I used subscripting.&lt;/P&gt;
&lt;P&gt;If I have it inside the function, it does not work. I had to take it out:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

Open("Summary.jmp");

GraphXSize = 800;
GraphYSize = 600;

ParamsList = {
	{"Param1", "Name1", 0, -10, 10},
	{"Param2", "Name2", 50, 25, 75}
};

ParamGraph = Function (
	{parameter, title, tgt=., lsl=., usl=.},
	LOCAL(
		{Default Local},
		medianCol = parameter || "_Q50";
		stdevCol = parameter || "_StdDev";
		return = Graph Builder(
			Size(GraphXSize,GraphYSize),
			Show Control Panel(0),
			Show Footer(0),
			Show Legend(0),
			Variables(
				X(:Name("Lot")),
				Y(Column(medianCol)),
				Y(Column(stdevCol)),
				Color(:Lot)
			),
			Elements(
				Points(X, Y, Legend(6))	
			)
		);
	);
);


wind = New Window("Summary - Report", 
	For(i=1, i&amp;lt;=Length(ParamsList), i++,
		gb= ParamGraph(ParamsList[i][1], ParamsList[i][2], ParamsList[i][3], ParamsList[i][4], ParamsList[i][5]);
		rgb = gb &amp;lt;&amp;lt; report;
		rgb &amp;lt;&amp;lt; showtreestructure;
		IF(
			IsMissing(ParamsList[i][3]) == 0,
			rgb[PictureBox(1), GraphBuilderBox(1), GraphBuilderAxisBox(2)] &amp;lt;&amp;lt; Add Ref Line(ParamsList[i][3], "Solid", "Black", "TARGET", 1);
		);
		IF(
			IsMissing(ParamsList[i][4]) == 0,
			rgb[PictureBox(1), GraphBuilderBox(1), GraphBuilderAxisBox(2)] &amp;lt;&amp;lt; Add Ref Line(ParamsList[i][4], "Solid", "Purple", "LSL", 1);
		);
		IF(
			IsMissing(ParamsList[i][5]) == 0,
			rgb[PictureBox(1), GraphBuilderBox(1), GraphBuilderAxisBox(2)] &amp;lt;&amp;lt; Add Ref Line(ParamsList[i][5], "Solid", "Red", "USL", 1);
		);
		rgb[PictureBox(1), GraphBuilderBox(1), GraphBuilderTitleBox(1)] &amp;lt;&amp;lt; Set Text(ParamsList[i][2]);
		rgb[PictureBox(1), GraphBuilderBox(1), GraphBuilderTitleBox(3)] &amp;lt;&amp;lt; Set Text ("Median");
		rgb[PictureBox(1), GraphBuilderBox(1), GraphBuilderTitleBox(4)] &amp;lt;&amp;lt; Set Text ("Standard Deviation");	
	)
) &amp;lt;&amp;lt; Set Window Icon("Trellis");

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also note the line:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		rgb &amp;lt;&amp;lt; showtreestructure;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;If I don't have it, it does not work!&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And that's quite annoying since I don't know how to automatically close it after, but at least, it works now!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 21:07:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38464#M22516</guid>
      <dc:creator>matlag</dc:creator>
      <dc:date>2017-04-24T21:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38466#M22518</link>
      <description>&lt;P&gt;I think you will find this example a more straight forward way of handling what you want&lt;/P&gt;
&lt;P&gt;I am not sure of the final format being exactly correct, but I believe you can easily modify it to meet your needs&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

//Open("Summary.jmp");

// Create a Sample data table
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );

dt:npn1 &amp;lt;&amp;lt; delete property( "spec limits" );
dt:pnp1 &amp;lt;&amp;lt; delete property( "spec limits" );

dt:npn1 &amp;lt;&amp;lt; set name( "Param1" );
dt:pnp1 &amp;lt;&amp;lt; set name( "Param2" );
dt:lot_id &amp;lt;&amp;lt; set name( "lot" );

dtSumm = dt &amp;lt;&amp;lt; Summary(
	Group( :lot ),
	Median( :Param1 ),
	Std Dev( :Param1 ),
	Median( :Param2 ),
	Std Dev( :Param2 ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column stat" )
);
dtSumm:Param1 Median &amp;lt;&amp;lt; set name( "Param1_Q50" );
dtSumm:Param2 Median &amp;lt;&amp;lt; set name( "Param2_Q50" );
dtSumm:Param1 Std Dev &amp;lt;&amp;lt; set name( "Param1_StdDev" );
dtSumm:Param2 Std Dev &amp;lt;&amp;lt; set name( "Param2_StdDev" );

// Run the script
GraphXSize = 800;
GraphYSize = 600;

ParamsList = {{"Param1", "Name1", 0, -10, 10},
 {"Param2", "Name2", 50, 25, 75}};

ParamGraph = Function( {parameter, title, tgt = ., lsl = ., usl = .},
	Local( {Default Local},
		medianCol = parameter || "_Q50";
		stdevCol = parameter || "_StdDev";
		Eval(
			Substitute(
					Expr(
						gb = dtSumm &amp;lt;&amp;lt; Graph Builder(
							Size( __GraphXSize__, __GraphYSize__ ),
							Show Control Panel( 0 ),
							Show Legend( 0 ),
							Show Footer( 0 ),
							Variables( X( :lot ), Y( __Q50__ ), Y( __Std__ ), Color( :lot ) ),
							Elements( Position( 1, 1 ), Points( X, Y, Legend( 6 ) ) ),
							Elements( Position( 1, 2 ), Points( X, Y, Legend( 7 ) ) ),
							SendToReport(
								Dispatch( {}, "graph title", TextEditBox, {Set Text( __title__ )} ),
								Dispatch( {}, "Y title", TextEditBox, {Set Text( "Median" )} ),
								Dispatch( {}, "Y 1 title", TextEditBox, {Set Text( "Std Dev" )} )
							)
						)
					),
				Expr( __GraphXSize__ ), GraphXSize,
				Expr( __GraphYSize__ ), GraphYSize,
				Expr( __Q50__ ), Parse( MedianCol ),
				Expr( __Std__ ), Parse( stdevCol ),
				Expr( __Title__ ), title
			)
		);

		If( Is Missing( tgt ) == 0,
			report(gb)[AxisBox( 3 )] &amp;lt;&amp;lt; Add Ref Line( tgt, "Solid", Black, "TARGET", 1 )
		);
		If( Is Missing( lsl ) == 0,
			report(gb)[AxisBox( 3 )] &amp;lt;&amp;lt; Add Ref Line( lsl, "Solid", Purple, "LSL", 1 )
		);
		If( Is Missing( usl ) == 0,
			report(gb)[AxisBox( 3 )] &amp;lt;&amp;lt; Add Ref Line( usl, "Solid", Red, "USL", 1 )
		);
	)
);
	

New Window( "Summary - Report",
	For( i = 1, i &amp;lt;= Length( ParamsList ), i++,
		ParamGraph( ParamsList[i][1], ParamsList[i][2], ParamsList[i][3], ParamsList[i][4], ParamsList[i][5] )
	)
) &amp;lt;&amp;lt; Set Window Icon( "Trellis" );


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Apr 2017 01:08:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38466#M22518</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-04-25T01:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38478#M22524</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried it on my ref summary.jmp file, and...&lt;/P&gt;
&lt;PRE&gt;Cannot find TextEditBox[ "graph title" ] at {}
Cannot find TextEditBox[ "Y title" ] at {}
Cannot find TextEditBox[ "Y 1 title" ] at {}
Cannot subscript Display Box in access or evaluation of 'Subscript' , Report( gb )[/*###*/AxisBox( 3 )]
&lt;/PRE&gt;
&lt;P&gt;So, if this is a bug, I should mention I am on JMP 12.1.0 64bits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But anyway, it works with my (dirty) code, so I'll deal with it. I will just have a ton of tree structure windows to close...&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 12:52:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38478#M22524</guid>
      <dc:creator>matlag</dc:creator>
      <dc:date>2017-04-25T12:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38479#M22525</link>
      <description>&lt;P&gt;I ran my script with your summary table under JMP 12.2 and it ran without error. &amp;nbsp;Below is the script that includes your summary table, and my reworked script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

//Open("Summary.jmp");
dtsumm = New Table( "Summary",
	Add Rows( 6 ),
	New Column( "Lot",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4, 5, 6] )
	),
	New Column( "Param1_Q50",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [-3, 7, 8, -12, 5, 0] )
	),
	New Column( "Param1_StdDev",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [0.2, 1, 0.6, 2, 0.2, 0.3] )
	),
	New Column( "Param2_Q50",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [23, 18, 54, 62, 78, 45] )
	),
	New Column( "Param2_StdDev",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [0.9, 1.2, 7, 3.6, 4.2, 1] )
	)
);


// Run the script
GraphXSize = 800;
GraphYSize = 600;

ParamsList = {{"Param1", "Name1", 0, -10, 10},
 {"Param2", "Name2", 50, 25, 75}};

ParamGraph = Function( {parameter, title, tgt = ., lsl = ., usl = .},
	Local( {Default Local},
		medianCol = parameter || "_Q50";
		stdevCol = parameter || "_StdDev";
		Eval(
			Substitute(
					Expr(
						gb = dtSumm &amp;lt;&amp;lt; Graph Builder(
							Size( __GraphXSize__, __GraphYSize__ ),
							Show Control Panel( 0 ),
							Show Legend( 0 ),
							Show Footer( 0 ),
							Variables( X( :lot ), Y( __Q50__ ), Y( __Std__ ), Color( :lot ) ),
							Elements( Position( 1, 1 ), Points( X, Y, Legend( 6 ) ) ),
							Elements( Position( 1, 2 ), Points( X, Y, Legend( 7 ) ) ),
							SendToReport(
								Dispatch( {}, "graph title", TextEditBox, {Set Text( __title__ )} ),
								Dispatch( {}, "Y title", TextEditBox, {Set Text( "Median" )} ),
								Dispatch( {}, "Y 1 title", TextEditBox, {Set Text( "Std Dev" )} )
							)
						)
					),
				Expr( __GraphXSize__ ), GraphXSize,
				Expr( __GraphYSize__ ), GraphYSize,
				Expr( __Q50__ ), Parse( MedianCol ),
				Expr( __Std__ ), Parse( stdevCol ),
				Expr( __Title__ ), title
			)
		);

		If( Is Missing( tgt ) == 0,
			report(gb)[AxisBox( 3 )] &amp;lt;&amp;lt; Add Ref Line( tgt, "Solid", Black, "TARGET", 1 )
		);
		If( Is Missing( lsl ) == 0,
			report(gb)[AxisBox( 3 )] &amp;lt;&amp;lt; Add Ref Line( lsl, "Solid", Purple, "LSL", 1 )
		);
		If( Is Missing( usl ) == 0,
			report(gb)[AxisBox( 3 )] &amp;lt;&amp;lt; Add Ref Line( usl, "Solid", Red, "USL", 1 )
		);
	)
);
	

New Window( "Summary - Report",
	For( i = 1, i &amp;lt;= Length( ParamsList ), i++,
		ParamGraph( ParamsList[i][1], ParamsList[i][2], ParamsList[i][3], ParamsList[i][4], ParamsList[i][5] )
	)
) &amp;lt;&amp;lt; Set Window Icon( "Trellis" );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Apr 2017 13:20:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38479#M22525</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-04-25T13:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38480#M22526</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Indeed, it does work!&lt;/P&gt;
&lt;P&gt;I manually copied your changes and I made 2 mistakes:&lt;/P&gt;
&lt;P&gt;1. I didn't realize the "Element" lines were mandatory&lt;/P&gt;
&lt;P&gt;2. I worte "Parse(title)" instead of title&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I much prefer your solution (cleaner code and no "residus").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 13:35:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38480#M22526</guid>
      <dc:creator>matlag</dc:creator>
      <dc:date>2017-04-25T13:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dispatch to dynamically generated piled charts</title>
      <link>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38483#M22528</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cool Face.jpg" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5972i2FB1A92403938AA4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cool Face.jpg" alt="Cool Face.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 13:48:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dispatch-to-dynamically-generated-piled-charts/m-p/38483#M22528</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-04-25T13:48:45Z</dc:date>
    </item>
  </channel>
</rss>

