Legend not showing up saved PNGdt = Open( "\\someFile.jmp", invisible);
path = "\\path\to\folder\";
names = { "Amplitude 1/2 Vppse", "Amplitude Vppde"};
ngraphs = N Items( names );
For( ip = 1, ip <= ngraphs, ip++,
current_graph = dt << Variability Chart(
invisible,
Y( Column(dt, names[ip])),
X( :Temp, :vccl),
Std Dev Chart( 0 ),
SendToReport(
Dispatch(
{"Variability Chart for " || names[ip]},
"2",
ScaleBox,
{Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
),
Dispatch(
{"Variability Chart for " || names[ip]},
"Variability Chart",
FrameBox,
{Row Legend(
Serial,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Standard" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
current_graph rep = current_graph << Report;
chart_type = Char(current_graph << Title);
chart_type = Munger(chart_type, 1, "[]", "");
If(chart_type == "Variability Chart", name = current_graph rep[TextEditBox(1)] << Get Text );
name = Munger(name,1,"/", "_");
final_name = chart_type || "_" || name ;
picture_path = path || Char(final_name) || ".png";
current_graph << Save Picture( picture_path, "png" );
)
Help! So I have managed to make a for loop to make a graph for each column that I put in my array. This actually works
BUT, it looks like the legend does not show up even though I have it in the script.
I also notice that in a blank jmp file that just has data and no scripts that run, my data points are just black dots instead of the colored markers I have specified in my script. Is this connected? Do I have to run a script in the data set, and then run the whole .jsl script like the one above after? Why isn't my legend showing up the way I have it specified in my script.
Re: Legend not showing up saved PNGA similar script worked for me with sample data. Are you trying to color by the "Serial" column, or by the measurement column?
Re: Legend not showing up saved PNGby the serial. I have multiple parts that had several tests run on them. I want to see the serial number in a color and marker as shown in my script. I'll add a picture to my original post to show the resultsRe: Legend not showing up saved PNGOk, it appears that the issue when doing this within a loop is that the Dispatch() statement cannot take an expression like ("Variability Chart for " || names[ip]). I think you will be better off not using SendToReport and instead add:
current_graph rep[Frame Box(1)] << Row Legend(...)
Re: Legend not showing up saved PNGHow exactly would I do that when I have two Dispatch inside of the SendToReport? Or do I do it twice like the code below?
current_graph rep[Frame Box(1)] <<
Dispatch(
{"Variability Chart for " || names[ip]},
"2",
ScaleBox,
{Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
),<BR />current_graph rep[Frame Box(1)] <<
Dispatch(
{"Variability Chart for " || names[ip]},
"Variability Chart",
FrameBox,
{Row Legend(
Serial,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Standard" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
);Re: Legend not showing up saved PNGI should have said that you can avoid both SendToReport and Dispatch. Each Dispatch command essentially identifies a display box and sends it a message. After the platform launches, your two commands would become:
</CODE></PRE>
<P> </P>
<P> </P>
<P> </P></LINGO-BODY><LINGO-SUB id="lingo-sub-232818" slang="en-US">Re: Legend not showing up saved PNG</LINGO-SUB><LINGO-BODY id="lingo-body-232818" slang="en-US"><P>Thanks! At first it wasn't working, but I added </P><PRE><CODE class=" language-jsl">current_graph rep = current_graph << Report;<BR />current_graph rep[Scale Box(2)] << Label Row(...);<BR />current_graph rep<SPAN class="token punctuation">[</SPAN>Frame Box<SPAN class="token punctuation">(</SPAN><SPAN class="token number">1</SPAN><SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">]</SPAN> <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN> Row Legend(...);
before the Frame Box and Scale Box, and it seemed to do the trick. Thank you!!!!!!!!