Anybody know how to load a picture file (.jpg) into Graph Builder using JSL? In an interactive session you can drag and drop, it's just not clear to me how this is done by JSL. It looks like there is some kind of Char To Blob requirement but I've tried a bunch of things without success.
Try this. Not the prettiest code, but gets the job done. Not sure if it can be made simpler.
Don
tblRef = Open("$Sample_Data/big class.jmp");
pathToImage = ""; //Put path to image here
gbPlt = Graph Builder(
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ), Overlay( :sex ) ),
Elements( Line( X, Y, Legend( 3 ) ), Points( X, Y, Legend( 4 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
4,
Base( 0, 0, 0 ),
Base( 1, 0, 1 ),
Properties( 0, {Marker( "Plus" )} ),
Properties( 1, {Marker( "Square" )} )
)}
)
)
);
Report(gbPlt)[Frame Box(1)] << Add Image(Open(pathToImage));
iSeg = Report(gbPlt)[Frame Box(1)] << Find Seg(Pict Seg(1));
iSeg << Fill Graph;