The SAS Output Delivery System and reporting techniques

ODS HTML and Tool Tips

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

ODS HTML and Tool Tips

[ Edited ]

I have a data set with 152 observations. Each obs is a lab result and there are about 40 unique patients in the data set. Obviously some will have more results than other. The goal is to monitor the fluctuation of their results over time. What I want to do is be able to have the output in an HTML  format so that I can use Tool Tips to identify the name of the patient when looking at outliers and drastic increases. The variable that I want to show when I hover the cursor over the graph is named "last" as in last name. The code thus far, which produces the graph I want in attached, Now i just need to add the Tool Tip Boxes. Please Help. 

 

ods _all_ close;
options orientation=landscape;
ods html path="c:\users\rgclevenger\desktop" (url=none) file="test.html"  ;
ods graphics on;

proc gplot data=work.graph ;
				plot results*diff=first / grid nolegend;
				by discharged ;
				
				
			run;

ods html close;
ods listing;

The data will look something like:

Last       First     diff           results      discharged

smith     Jack     3 month  10008        enrolled

smith     Jack     6 month  204            enrolled

smith     Jack     9 month  20              enrolled

doe       John     3 month  270000      Discharged

doe       John     6 month  782            Discharged

 

What Could it take to have the Last name pop up as tool tip text?

What would it take to have the First Initial and last name  as tool tip text?


Accepted Solutions
Solution
‎04-24-2018 08:19 AM
Contributor
Posts: 22

Re: ODS HTML and Tool Tips

So, I found out that the way to plot ALL patients while providing a different colors for specific groups of patients is to use a spaghetti plot using the series x= y= / group= grouplc= grouplp= name= smoothconnect= tip=(  ) statement in a proc sgplot. The tip= option provides the tool tip text that I want given the the statement "ods graphics / imagemap = on" is above the procedure statement.

View solution in original post


All Replies
Respected Advisor
Posts: 3,258

Re: ODS HTML and Tool Tips

In the data step that creates work.graph, you need to create a character variable that has the desired HTML code, lets call this variable name simple TEXT.

 

text=cat("title='",last,' ',substr(first,1,1),'");

Then in your PROC GPLOT you need to modify the PLOT statement to be

 

plot results*diff=first / grid nolegend html=text;
--
Paige Miller
Contributor
Posts: 22

Re: ODS HTML and Tool Tips

Posted in reply to PaigeMiller

Just for my information, why does specifying html=last not work? If the Variable is character and already exists wouldn't it produce the same thing?

Respected Advisor
Posts: 3,258

Re: ODS HTML and Tool Tips

[ Edited ]

Just for my information, why does specifying html=last not work?

 

Variable LAST does not contain HTML code.

 

Minor correction to my code

 

text=cat("title='",last,' ',substr(first,1,1),"'");

 

 

 

--
Paige Miller
Contributor
Posts: 22

Re: ODS HTML and Tool Tips

Posted in reply to PaigeMiller

ALSO... I definitely was able to create a variable with exactly what I could like to appear but it is no different when I specify that Variable or another other Variable in the HTML= option. Nothing is appearing in the graph area as tool tip text. There must me something else that I am not doing. 

Solution
‎04-24-2018 08:19 AM
Contributor
Posts: 22

Re: ODS HTML and Tool Tips

So, I found out that the way to plot ALL patients while providing a different colors for specific groups of patients is to use a spaghetti plot using the series x= y= / group= grouplc= grouplp= name= smoothconnect= tip=(  ) statement in a proc sgplot. The tip= option provides the tool tip text that I want given the the statement "ods graphics / imagemap = on" is above the procedure statement.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 233 views
  • 0 likes
  • 2 in conversation