Hello,
I want to apply the color defined in my pattern statement to the pie chart. Below is my data:
data temp;
input group $ count percent color $;
datalines;
G3 179 37 CX191714
A1 138 28 CX26251F
G1 114 23 CX33322E
M 36 7 CX8C7962
A2 17 3 CX806A2B
G2 2 0 CX8C887A
G4 2 0 CXA69F7A
A 0 0 CXA6A18A
D 0 0 CXBFB2B5
E 0 0 CXFFFFFF
;
run;
The last column is the color code I define by myself. However, when I used the following code to draw the pie chart for group. SAS used some other colors instead of my color list. Below is my code:
data _null_;
set temp;
CALL SYMPUT('SliceColor'!!TRIM(LEFT('_N_')),TRIM(LEFT(COLOR)));
RUN;
%MACRO PatternStatements;
%DO i=1 %TO 10;
pattern&i V=PSOLID COLOR=&&SliceColor&i;
%END;
%MEND;
%PatternStatements;
PROC GCHART DATA=temp;
PIE group / SUMVAR=COUNT NOHEADING SLICE=OUTSIDE VALUE=NONE PERCENT=NONE DESCENDING OTHER=0;
RUN;
QUIT;
SAS log didn't give any error message but when I call patternstatements macro, log gave this:
MPRINT(PATTERNSTATEMENTS): pattern1 V=PSOLID COLOR=CXD9892B;
MPRINT(PATTERNSTATEMENTS): pattern2 V=PSOLID COLOR=CXD9576E;
MPRINT(PATTERNSTATEMENTS): pattern3 V=PSOLID COLOR=CXFFFFFF;
MPRINT(PATTERNSTATEMENTS): pattern4 V=PSOLID COLOR=CX769966;
MPRINT(PATTERNSTATEMENTS): pattern5 V=PSOLID COLOR=CX8C411C;
MPRINT(PATTERNSTATEMENTS): pattern6 V=PSOLID COLOR=CX99FFFF;
MPRINT(PATTERNSTATEMENTS): pattern7 V=PSOLID COLOR=CX9999FF;
MPRINT(PATTERNSTATEMENTS): pattern8 V=PSOLID COLOR=CXFFFF99;
MPRINT(PATTERNSTATEMENTS): pattern9 V=PSOLID COLOR=CX999999;
MPRINT(PATTERNSTATEMENTS): pattern10 V=PSOLID COLOR=CX99FF99;
This is not my list defined in the pattern statement. I really couldn't understand how this happened. Does anyone give me some help? Thank you very much.
Lu