BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Dave25
Quartz | Level 8

 

on a previous post, BrianMc asked about creating a file to share with others, that would include tips

ODS LISTING CLOSE;

ODS HTML PATH='c:\_Stuff' (URL=NONE)

BODY='BUBBLE.HTML'

STYLE=ANALYSIS;

ODS GRAPHICS / reset=all imagemap=on border=off antialiasmax=1800 tipmax=1800;

GOPTIONS NODISPLAY;

GOPTIONS XPIXELS=1200 YPIXELS=800;

ODS LISTING CLOSE;

ODS HTML PATH='c:\_Stuff' (URL=NONE)

BODY='BUBBLE.HTML'

STYLE=ANALYSIS;

ODS GRAPHICS / reset=all imagemap=on border=off antialiasmax=1800 tipmax=1800;

GOPTIONS NODISPLAY;

GOPTIONS XPIXELS=1200 YPIXELS=800;

 

 

RobertAllison responded that:

You can't just save the image - you must have both the image and the html (and view them in a Web browser) to see the tooltips.

 

So, my question -  is there a way to do this? (save and share both?)

Thanks,

Dave

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

If you are using SAS 9.4, you can get the HTML5 desitnation to embed the image into the HTML file, as well as the image map. It's a great way to send rich HTML content to someone via e-mail.

 

data test;
input PCT_PROF PCT_FR_LUNCH;
Tips = 'PCT PROF: '|| strip(put(PCT_PROF, percent10.))|| ' / PCT FR Lunch: '|| strip(put( PCT_FR_LUNCH, percent10.));
cards;
.5 .4
.7 .5
.9 .6
;
run;
ods graphics / reset;
ods html5 path="." (url=none) file="test.html" options(bitmap_mode="inline");
ods graphics / imagemap=on height=7in width=9in imagefmt=png;

proc sgplot data=test;
Scatter y = PCT_PROF x = PCT_FR_LUNCH /markerattrs=(symbol=circlefilled color=blue size = 8) tip=(tips);
run;
ods html5 close;

Hope this helps!

Dan

View solution in original post

6 REPLIES 6
Reeza
Super User

I don't think so, this is a limitation of the formats that are exported.

ie PNG don't support tooltips, pretty much only HTML does.

Cynthia_sas
SAS Super FREQ
Hi: you have a mix of ODS GRAPHICS statements and GOPTIONS statements, but do not show your GRAPH code. The challenge with answering your question is that it really will depend on your SAS code. The option you use for tooltips with the SG Procedures is different from the options you use with SAS/GRAPH procedures.

And, if you want to insert accessible information into ODS output, you can use the accessible option on your GOPTIONS statement when you are using SAS/GRAPH.

So what is the rest of the code you are using for this ODS HTML file?

cynthia
Dave25
Quartz | Level 8

I've tried a number of different  ways of doing the ods html statement, but here's one (it does create the htm file, which has the tips when I open it, but not when I send it)

Thanks!

 

Pared down data and code:

 


data test;
input PCT_PROF PCT_FR_LUNCH;
Tips = 'PCT PROF: '|| strip(put(PCT_PROF, percent10.))|| ' / PCT FR Lunch: '|| strip(put( PCT_FR_LUNCH, percent10.));
cards;
.5 .4
.7 .5
.9 .6
;
run;
ods graphics / reset;

ods html file='C:\a\sgplot.htm'   body='plot.htm' ;
ods graphics / imagemap=on height=7in width=9in;

proc sgplot data=test;
Scatter y = PCT_PROF x = PCT_FR_LUNCH /markerattrs=(symbol=circlefilled color=blue size = 😎 tip=(tips);
run;

ods html close;

Cynthia_sas
SAS Super FREQ
Hi, why do you have both a FILE= and a BODY=. I would expect to see PATH= and either FILE= or BODY=, but not both. Are you sure your files are being created correctly?

cynthia
DanH_sas
SAS Super FREQ

If you are using SAS 9.4, you can get the HTML5 desitnation to embed the image into the HTML file, as well as the image map. It's a great way to send rich HTML content to someone via e-mail.

 

data test;
input PCT_PROF PCT_FR_LUNCH;
Tips = 'PCT PROF: '|| strip(put(PCT_PROF, percent10.))|| ' / PCT FR Lunch: '|| strip(put( PCT_FR_LUNCH, percent10.));
cards;
.5 .4
.7 .5
.9 .6
;
run;
ods graphics / reset;
ods html5 path="." (url=none) file="test.html" options(bitmap_mode="inline");
ods graphics / imagemap=on height=7in width=9in imagefmt=png;

proc sgplot data=test;
Scatter y = PCT_PROF x = PCT_FR_LUNCH /markerattrs=(symbol=circlefilled color=blue size = 8) tip=(tips);
run;
ods html5 close;

Hope this helps!

Dan

Dave25
Quartz | Level 8
exactly what I was hoping to get -- thank you!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2342 views
  • 3 likes
  • 4 in conversation