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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
rcleven2
Obsidian | Level 7

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

5 REPLIES 5
PaigeMiller
Diamond | Level 26

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
rcleven2
Obsidian | Level 7

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?

PaigeMiller
Diamond | Level 26

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
rcleven2
Obsidian | Level 7

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. 

rcleven2
Obsidian | Level 7

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 1118 views
  • 0 likes
  • 2 in conversation