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
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
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.
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;
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
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.