Click here to see the SAS code.
Click here to see the example.
---------------------------------------------------------------
When a chart has a lot of bars, and it's difficult to visually 'group'
them and follow the bars down to the horizontal axis, it is sometimes
useful to make certain bars a different color, to use them in a similar
way to reference lines.
You can add a variable to the dataset, such as ...
if int(age/10)=(age/10) then even_10='y';
else even_10='n';
And then use that variable to color the bars (using the subgroup option).
proc gchart data=my_data anno=anno_age;
format early_voters comma8.0;
vbar age / discrete type=sum sumvar=early_voters
subgroup=even_10 nolegend
noframe raxis=axis1 maxis=axis2
autoref cref=graydd clipref
space=0 coutline=gray99
html=my_html
des='' name="&name";
run;
Back to Samples Index