BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi

when using proc gbarline to create a bar-line diagram is there any way to show the sum of the bars as well as the sum of the line values in the diagram? I know that you can use ouside=sum or inside=sum to write the values of the bar, but we would like to show the values of the vaiable shown as a line in the same diagram as well.

Thanks for your held.
Sandra
4 REPLIES 4
GraphGuy
Meteorite | Level 14

I know this question has been sitting around a while - better late than never! 🙂

I've run into the same limitation - currently, I do not think there is a way to do this with gbarline.

There is a request (S0175859) to have gbarline support the 'pointlabel' option on the symbol statement.

And also a request (S0293117) to have gbarline support 'annotate' on the plot line.

But neither of these are available as of the 9.3 release.

Perhaps somebody knows of a work-around with proc sgplot(?)

ArtC
Rhodochrosite | Level 12

Although not as straight forward as GBARLINE it is possible to obtain some of the same functionality with GPLOT and annotate.

GraphGuy
Meteorite | Level 14

Or even without annotate ... but there are tradeoffs & limitations Smiley Happy

axis1 label=(angle=90);

axis2 label=(angle=90);

axis3 value=(angle=90) minor=none;

symbol1 value=none interpol=needle width=7 color=blue

pointlabel=(color=blue position=top height=1.5pct);

symbol2 value=dot interpol=join color=red

pointlabel=(color=red height=1.5pct);

proc gplot data=sashelp.tourism;

format vsp cpisp comma5.1;

plot vsp*year=1 / vaxis=axis1 haxis=axis3;

plot2 cpisp*year=2 / vaxis=axis2;

run;

DanH_sas
SAS Super FREQ

This SGPLOT code should give you the equivalent result of GBARLINE with data labels on both charts:

proc sgplot data=sashelp.class;

y2axis min=0;

vbar age / response=height datalabel;

vline age / response=weight y2axis datalabel;

run;

Thanks!
Dan

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1690 views
  • 0 likes
  • 4 in conversation