BookmarkSubscribeRSS Feed
CLE
Obsidian | Level 7 CLE
Obsidian | Level 7

I'm trying to add data labels to one of my plotted lines against the y axis (I have two y axis bars). All it does is put a little dot where it is supposed to be putting the value of char_var from the AMT_VAC_SUMMARY data set. Count_of_EMPL_IND is a numeric variable and I'm attempting to use the put line to rename it and change it to a character value.  Any help is appreciated. I've spend 8+ hours trying to teach myself how to do this function! 

 

Main data table: AMT_VAC_SUMMARY

 

Current code: 

%annomac;
data AMT_VAC_SUMMARY2;
length funciton style color $8 text $50;
set AMT_VAC_SUMMARY;
%annomac;
%system(2,2);
char_var=put(Count_of_EMPL_IND,3.);
if Count_of_AOD_EMPL_IND>=0 then do;
%label (Cal_Month,Count_of_AOD_EMPL_IND,char_var,orange,0,0,3,zapf,2);
end; 

 

 

1 REPLY 1
Urban_Science
Quartz | Level 8

CLE,

While this does not answer your question about gplot, have you considered using sgplot instead?  if your goal is to label a series, sgplot does not require an annotation dataset to label points on a graph.  Here is a link to the sgplot's documentation for more infomation about sgplot.

 

Here is a quick example of how to graph two lines on both y-axis and label one of them using sgplot.

proc sgplot data=sashelp.cars (where=(make="Audi"));
	vline  EngineSize / response = Horsepower 
		datalabel= Horsepower;
	vline EngineSize / response=MPG_Highway
		y2axis;
run;

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 1802 views
  • 0 likes
  • 2 in conversation