Can Someone please let me know how the attached Stacked Horizontal Bar graph was produced using GCHART Procedure? I found this Sample graph online a couple of years ago but do not know how this was produced at that time. It is Obviously using SASHELP.CLASS dataset.
Also can this easily be produced via SGPLOT too? I am using SAS 9.4M3.
Thanks,
Here is a link to the original thread that featured this image:
Your PDF isn't displaying but here's a link to the Graph Gallery,
https://support.sas.com/sassamples/graphgallery/PROC_GCHART_Graph_Types_Charts_Bar.html
Hi Reeza,
The PDF should be displaying. Are you able to download it and then view?
No, include as an image in your main post.
Or someone else can answer your question.
I have posted the Image of the graph.
Thanks.
Here is a link to the original thread that featured this image:
Thanks @Rick_SAS .It looks like this Graph is easier using GCHART than SGPLOT.
What is "easy" depend on the individual. If you find GCHART easier, that's fine. Personally, I don't think it is too hard to run a data step to find the center of each block and then use the TEXT statement to plot the names:
proc sort data=sashelp.class out=class;
by age;
run;
data class;
set class;
by age;
if first.age then cumheight = height/2;
else cumHeight + height;
run;
proc sgplot data=class noautolegend;
hbarbasic age / response=height group=name groupdisplay=stack;
text y=age x=cumHeight text=name;
run;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.