Data visualization with SAS programming

Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

Accepted Solution Solved
Reply
Contributor
Posts: 25
Accepted Solution

Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

 

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

 


Accepted Solutions
Solution
‎03-09-2017 12:15 PM
SAS Super FREQ
Posts: 864

Re: Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

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


All Replies
Grand Advisor
Posts: 16,393

Re: Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

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.

SAS Super FREQ
Posts: 8,645

Re: Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

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
Contributor
Posts: 25

Re: Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

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 = 8) tip=(tips);
run;

ods html close;

SAS Super FREQ
Posts: 8,645

Re: Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

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
Solution
‎03-09-2017 12:15 PM
SAS Super FREQ
Posts: 864

Re: Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

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

Contributor
Posts: 25

Re: Re-asking question from 2015: How do I get tooltips to display for other users on saved images?

exactly what I was hoping to get -- thank you!!
Post a Question
Discussion Stats
  • 6 replies
  • 128 views
  • 3 likes
  • 4 in conversation