cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
bzanos
Level III

How to hide/remove border line around a graph?

Hi All,

 

I am using JMP Pro14.3. I am constructing a graph using Graph Builder and save if as html file. I would like to hide the border line around the graph but did not success. I am adding this line of code aa[ListBox(2)] << Visibility("Hidden"); , the graph is missing.

Below is my code. I need the community help to take a look if anything wrong with the code.

 

Capture (1).PNG

dt = Open( "$SAMPLE_DATA/big class.jmp" );

grp = dt << Graph Builder(
	              Size( 528, 464 ),
	              Show Control Panel( 0 ),
	              Variables( X( :name ), Y( :height ) ),
	              Elements( Bar( X, Y, Legend( 6 ) ) )
);

aa = Report(grp);
aa[ListBox(2)] << Visibility("Hidden");

aa << Save HTML("C:\Users\xxx\Downloads\grp.html");
1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: How to hide/remove border line around a graph?

Here's a workaround.

dt = Open( "$SAMPLE_DATA/big class.jmp" );

grp = dt << Graph Builder(
	              Size( 528, 464 ),
	              Show Control Panel( 0 ),
	              Variables( X( :name ), Y( :height ) ),
	              Elements( Bar( X, Y, Legend( 6 ) ) )
);

aa = Report(grp);

aa << Save HTML("$temp\grp.html");

/* repair the html
<!doctype html public "-//W3C//DTD HTML 4.0//EN">
<html><head><title>
JMP Report
</title><style>
body { font-family: Arial, sans-serif; font-size: 12px; padding: 0; margin: 10px; }
table { border-color: #a9a9a9; border-collapse: collapse; }
td,th { border-color: #a9a9a9; }
img { border: 1px solid #a9a9a9; } <<<<<<<<<<<< this causes the border
h1,h2,h3,h4,h5 { padding: 0; margin: 5px 0px; }
</style>
</head><body>
<img src="gfx/image37489392371.png" width=637 height=471><br> 

</body></html>
*/

htmlTxt = loadtextfile("$temp\grp.html");
htmlTxt = regex(htmlTxt, "img \{ border: 1px solid #a9a9a9; \}", "", GLOBALREPLACE);
savetextfile("$temp\grp.html",htmlTxt);
open("$temp\grp.html");

The problem is with the generated HTML; it includes a style to draw the outline around the picture. This seems to work in JMP 14...17. No promises.

Craige

View solution in original post

5 REPLIES 5
Craige_Hales
Super User

Re: How to hide/remove border line around a graph?

Good question. I agree, that extra box is not needed. I can't figure out how to make it go away either.

Craige

Re: How to hide/remove border line around a graph?

Does this preference help?

 

border.PNG

Craige_Hales
Super User

Re: How to hide/remove border line around a graph?

The Graph Border preference? I can't see that it changes anything, except in the pref window. That does look like the border in question. Here's the JSL I tested with in 16...

dt = Open( "$SAMPLE_DATA/big class.jmp" );

grp = dt << Graph Builder(
	              Size( 528, 464 ),
	              Show Control Panel( 0 ),
	              Variables( X( :name ), Y( :height ) ),
	              Elements( Bar( X, Y, Legend( 6 ) ) )
);

aa = Report(grp);

aa << Save HTML("$Downloads\grp.html");
open("$Downloads\grp.html")

Be sure you are looking at the browser window, not the graph builder window, to decide if the border is suppressed.

 

Craige
Craige_Hales
Super User

Re: How to hide/remove border line around a graph?

Here's a workaround.

dt = Open( "$SAMPLE_DATA/big class.jmp" );

grp = dt << Graph Builder(
	              Size( 528, 464 ),
	              Show Control Panel( 0 ),
	              Variables( X( :name ), Y( :height ) ),
	              Elements( Bar( X, Y, Legend( 6 ) ) )
);

aa = Report(grp);

aa << Save HTML("$temp\grp.html");

/* repair the html
<!doctype html public "-//W3C//DTD HTML 4.0//EN">
<html><head><title>
JMP Report
</title><style>
body { font-family: Arial, sans-serif; font-size: 12px; padding: 0; margin: 10px; }
table { border-color: #a9a9a9; border-collapse: collapse; }
td,th { border-color: #a9a9a9; }
img { border: 1px solid #a9a9a9; } <<<<<<<<<<<< this causes the border
h1,h2,h3,h4,h5 { padding: 0; margin: 5px 0px; }
</style>
</head><body>
<img src="gfx/image37489392371.png" width=637 height=471><br> 

</body></html>
*/

htmlTxt = loadtextfile("$temp\grp.html");
htmlTxt = regex(htmlTxt, "img \{ border: 1px solid #a9a9a9; \}", "", GLOBALREPLACE);
savetextfile("$temp\grp.html",htmlTxt);
open("$temp\grp.html");

The problem is with the generated HTML; it includes a style to draw the outline around the picture. This seems to work in JMP 14...17. No promises.

Craige
bzanos
Level III

Re: How to hide/remove border line around a graph?

Hi Craige,

 

This is great. Thank you!