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

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