Another brain teaser for the scripters out there...
If I have a graph that looks like this:

dt = Open("$Sample_Data/Big Class.jmp");
graph = dt << Graph Builder(
Size( 532, 452 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
How would I make it look like below, after the graph window had been created and using only messages to graph builder itself (i.e. let's consider row states off the table). Via the GUI, I'd do it by right clicking on the marker next to "height" in the legend and changing the marker and color. I can't figure out how to do that via JSL messaging, though.

dt = Open("$Sample_Data/Big Class.jmp");<BR /><BR />graph = Graph Builder(
Size( 532, 452 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
3,
Properties(
0,
{Line Color( 51 ), Marker( "Filled Down Triangle" )},
Item ID( "height", 1 )
)
)}
)
)
);
Thoughts?
M
Hi Mike-
I think you can do this by setting values in the legend using Legend Server and Legend Item. I was recently trying to do something similar and came across these functions.
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
server = gb << get legend server;
item1 = server << get legend item( 3, 1 );
item1 << set properties(
{
marker size ( 5 ),
marker ("Filled Down Triangle"),
Line Color ( 19 )
}
);
item2 = server << get legend item( 4, 1 );
item2 << set properties(
{
Line Color ( 25 ),
Line Style ( 2 )
}
);
-Scott
I was thinking the same thing, but I guess there's something about that strategy that doesn't work right when it's inside of the a dashboard / application builder window. I can't seem to get the hook into the Legend Server.