03-06-2015 10:40 AM
I have created an 3D block chat using PROC GPLOT's BLOCK statement (code below).
I would like to show the number and percentage of occurrences in each cell as N (x.x%). I have found ways to show either the total or the percentages, but not both at the same time. (Actually I was able to do both with a format trick, but when the text string exceeded 8 characters it was truncated.) Anyway, it seems the solution is an annotation dataset--So I created one. Unfortunately, the block statement is completely ignoring it. I hope someone can tell me what I need to do to make the block statement respect the anotation data set.
The example program below uses dataset SASHELP.CLASS.
Any help is appreciated.
if key>.7 then response='Yes';
proc freq data=work.class noprint;
tables sex*age*response/list missing out=freqout;
length color style $ 8 text $20;
retain color "white" when "a" style "arial"
xsys ysys "2" position "5" size 4 hsys "3";
text=strip(put(count,6.))|| ' ' || '(' || strip(put((percent/100),percent6.1)) || ')' ;
goptions colors=(/*tomato,*/ orange, vligb, purple);
PROC GCHART DATA=WORK.freqout ;
BLOCK agec / CAXES=black freq=count noheading ANNO=annotate
TYpe=freq /* freq or percent to change what numbers are displayed */
run ; quit;