- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 09-24-2009 03:45 PM
(3927 views)
Hi all,
I tried to use the datalabel option to display values for vbar in proc sgplot. It gives syntax error.
Does datalabel option not work. What is a workaroud to display values.
Regards,
Amit
I tried to use the datalabel option to display values for vbar in proc sgplot. It gives syntax error.
Does datalabel option not work. What is a workaroud to display values.
Regards,
Amit
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
DATALABEL support for bar charts was not added until 9.2 phase 2. Do you have 9.2 phase 1 or phase 2?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
As a workaround, you could use GTL with a bar/scatter overlay. The code below will produce a bar chart like you would see from SGPLOT with the labels added:
proc template;
define statgraph barlabel;
begingraph;
layout overlay;
barchartparm x=age y=height;
scatterplot x=age y=eval(height+5) / markercharacter=height;
endlayout;
endgraph;
end;
run;
proc summary data=sashelp.class noprint nway;
class age;
var height;
output out=barsum sum=;
run;
proc sgrender data=barsum template=barlabel; run;
proc template;
define statgraph barlabel;
begingraph;
layout overlay;
barchartparm x=age y=height;
scatterplot x=age y=eval(height+5) / markercharacter=height;
endlayout;
endgraph;
end;
run;
proc summary data=sashelp.class noprint nway;
class age;
var height;
output out=barsum sum=;
run;
proc sgrender data=barsum template=barlabel; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dan,
My SAS version is : SAS 9.2 TS Level2MO. The workaround worked.
I appreciate all your help.
Regards,
Amit
My SAS version is : SAS 9.2 TS Level2MO. The workaround worked.
I appreciate all your help.
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
TS2 is phase 2, so DATALABEL on the bar chart should be available to you. Does the following code run for you?
proc sgplot data=sashelp.class;
vbar age / response=height stat=mean datalabel;
run;
proc sgplot data=sashelp.class;
vbar age / response=height stat=mean datalabel;
run;