From: Randy Herbison on
Yang,

You may want to see this paper by Susan Swartz:

http://support.sas.com/rnd/datavisualization/papers/sgf2009/174-2009.pdf

In the paper, she shows how to use SG procedures to create different types of group bar charts. You can get the GTL, generated for the PROCs, by adding TMPLOUT=FILENAME to the PROC statement, or by using the templates browser to view the GTL in the WORK library.

-Randy

-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L(a)LISTSERV.UGA.EDU] On Behalf Of yang wang
Sent: Friday, November 20, 2009 12:52 PM
To: SAS-L(a)LISTSERV.UGA.EDU
Subject: Barchart with Graph Template Language

Hi there,

I was trying to create a barchart (type) by group (origin) using GTL using the following code. I would like the groups to be side-by-side rather than stacking on each other. So far I haven't found any option in the BARCHART statement that can achieve this. Can anyone help?

I actually got the result I need by using PROC GCHART but I like to explore the power of GTL since it provides some nice feature and flexibility.

Thank you.

Yang

*** SAS code ***;
proc template;
define statgraph barchart;
begingraph;
layout overlay;
barchart x=type /orient=vertical
group=origin name="grouped";
discretelegend "grouped";
endlayout;
endgraph;
end;
run;

proc sgrender data=sashelp.cars template=barchart;
run;
*** End of SAS code ***;