BookmarkSubscribeRSS Feed
MPaola
Calcite | Level 5
Is it possibile to create a graph with proc gbarline with 2 BAR statements?
Thanks
MPaola
4 REPLIES 4
DanH_sas
SAS Super FREQ
No, but it is possible to do this with PROC SGPLOT if you have SAS 9.2. What version of SAS are you running?
MPaola
Calcite | Level 5
I use SAS 9.2.
I need to include in the same graph: 2 bars and 3 lines.
Is it possible with a PROC SGPLOT? If yes, where can i find a good paper which teachs me using PROC SGPLOT?

Thanks for help
MPaola
DanH_sas
SAS Super FREQ
Hey MPaola,

The documentation for the SG procedures should help a lot. You can also go to the support site and search for "Dan Heath" to find a number of related papers I've written. In the meantime, here is a very simplistic example to demonstrate barline overlays:

[pre]
proc sgplot data=sashelp.class;
y2axis min=0;
vbar age / response=weight;
vbar age / response=height barwidth=0.5;
vline age / response=weight y2axis lineattrs=GraphData1(thickness=2);
vline age / response=height y2axis lineattrs=GraphData2(thickness=2);
run;
[/pre]

Hope this helps,
Dan
MPaola
Calcite | Level 5
Perfect Dan!
Thanks a lot. I will read your papers!
MPaola

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1996 views
  • 0 likes
  • 2 in conversation