BookmarkSubscribeRSS Feed
ccc143
Calcite | Level 5
The following code will produce graphs where the year is on the x axis and the num value will be on the y. I'd like the category value to display 'cat' or 'dog' when I mouse over it. However, this only works when I set "device=javameta", but not when I set "device=activex". I get errors when I try to open the html in javameta, but am able to open the html in activex without errors. Is there a way to get the popup to display the category value ('cat' or 'dog') instead of the axis values when I scroll over it in activex setting?

Thanks!!!



data test1;
input year cat $3. num;
datalines;
1 cat 469.9
1 dog 287.1
2 cat 494.3
2 dog 261.6
;
run;

data test2;
set test1;
*** ADD A NEW VARIABLE (POPUP) WITH A TIP= TAG;
popup = 'tip=['||quote(cat) ||']';
run;
*** SELECT THE JAVAMETA DEVICE DRIVER, SET SIZE, FONT;
goptions reset=all
device=activex
xpixels=800
ypixels=600
ftext='HelveticaBold'
htext=3
gunit=pct;

ods listing close;
ods html file="h:\testpop.html";

proc gplot data=test2;
plot1 num*year /html=popup;
symbol1 v=dot c=blue;
run;
quit;
ods html close;
ods listing;
;
2 REPLIES 2
GraphGuy
Meteorite | Level 14

I think that the tip= is a javameta-only thing.

To make your code more portable & more likely to work with various different device='s, I would recommend using the standard html tags (either alt= or title=), such as ...

popup = 'title='||quote(cat);

I'm not 100% sure this will work in all devices (activex, java, javameta) - and it will also depend on which version you have.  I would recommend using "ods html" and device=png.

ccc143
Calcite | Level 5

That worked!!  Thanks!!!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1498 views
  • 1 like
  • 2 in conversation