<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic color rotation in pie chart in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/color-rotation-in-pie-chart/m-p/15378#M298</link>
    <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I want to apply the color defined in my pattern statement to the pie chart. Below is my data:&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
   input group $ count percent color $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
G3 179 37 CX191714&lt;BR /&gt;
A1 138 28 CX26251F&lt;BR /&gt;
G1 114 23 CX33322E&lt;BR /&gt;
M  36  7  CX8C7962&lt;BR /&gt;
A2 17  3  CX806A2B&lt;BR /&gt;
G2 2   0  CX8C887A&lt;BR /&gt;
G4 2   0  CXA69F7A&lt;BR /&gt;
A  0   0  CXA6A18A&lt;BR /&gt;
D  0   0  CXBFB2B5&lt;BR /&gt;
E  0   0  CXFFFFFF&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
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:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   set temp;&lt;BR /&gt;
   CALL SYMPUT('SliceColor'!!TRIM(LEFT('_N_')),TRIM(LEFT(COLOR)));&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
%MACRO PatternStatements;&lt;BR /&gt;
    %DO i=1 %TO 10;&lt;BR /&gt;
	   pattern&amp;amp;i V=PSOLID COLOR=&amp;amp;&amp;amp;SliceColor&amp;amp;i;&lt;BR /&gt;
	%END;&lt;BR /&gt;
%MEND;&lt;BR /&gt;
%PatternStatements;&lt;BR /&gt;
&lt;BR /&gt;
PROC GCHART DATA=temp;&lt;BR /&gt;
    PIE group / SUMVAR=COUNT NOHEADING SLICE=OUTSIDE VALUE=NONE PERCENT=NONE DESCENDING OTHER=0;&lt;BR /&gt;
RUN;&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
SAS log didn't give any error message but when I call patternstatements macro, log gave this:&lt;BR /&gt;
&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern1 V=PSOLID COLOR=CXD9892B;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern2 V=PSOLID COLOR=CXD9576E;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern3 V=PSOLID COLOR=CXFFFFFF;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern4 V=PSOLID COLOR=CX769966;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern5 V=PSOLID COLOR=CX8C411C;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern6 V=PSOLID COLOR=CX99FFFF;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern7 V=PSOLID COLOR=CX9999FF;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern8 V=PSOLID COLOR=CXFFFF99;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern9 V=PSOLID COLOR=CX999999;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern10 V=PSOLID COLOR=CX99FF99;&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Lu</description>
    <pubDate>Mon, 11 Oct 2010 20:13:57 GMT</pubDate>
    <dc:creator>lueryy2000</dc:creator>
    <dc:date>2010-10-11T20:13:57Z</dc:date>
    <item>
      <title>color rotation in pie chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/color-rotation-in-pie-chart/m-p/15378#M298</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I want to apply the color defined in my pattern statement to the pie chart. Below is my data:&lt;BR /&gt;
&lt;BR /&gt;
data temp;&lt;BR /&gt;
   input group $ count percent color $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
G3 179 37 CX191714&lt;BR /&gt;
A1 138 28 CX26251F&lt;BR /&gt;
G1 114 23 CX33322E&lt;BR /&gt;
M  36  7  CX8C7962&lt;BR /&gt;
A2 17  3  CX806A2B&lt;BR /&gt;
G2 2   0  CX8C887A&lt;BR /&gt;
G4 2   0  CXA69F7A&lt;BR /&gt;
A  0   0  CXA6A18A&lt;BR /&gt;
D  0   0  CXBFB2B5&lt;BR /&gt;
E  0   0  CXFFFFFF&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
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:&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   set temp;&lt;BR /&gt;
   CALL SYMPUT('SliceColor'!!TRIM(LEFT('_N_')),TRIM(LEFT(COLOR)));&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
%MACRO PatternStatements;&lt;BR /&gt;
    %DO i=1 %TO 10;&lt;BR /&gt;
	   pattern&amp;amp;i V=PSOLID COLOR=&amp;amp;&amp;amp;SliceColor&amp;amp;i;&lt;BR /&gt;
	%END;&lt;BR /&gt;
%MEND;&lt;BR /&gt;
%PatternStatements;&lt;BR /&gt;
&lt;BR /&gt;
PROC GCHART DATA=temp;&lt;BR /&gt;
    PIE group / SUMVAR=COUNT NOHEADING SLICE=OUTSIDE VALUE=NONE PERCENT=NONE DESCENDING OTHER=0;&lt;BR /&gt;
RUN;&lt;BR /&gt;
QUIT;&lt;BR /&gt;
&lt;BR /&gt;
SAS log didn't give any error message but when I call patternstatements macro, log gave this:&lt;BR /&gt;
&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern1 V=PSOLID COLOR=CXD9892B;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern2 V=PSOLID COLOR=CXD9576E;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern3 V=PSOLID COLOR=CXFFFFFF;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern4 V=PSOLID COLOR=CX769966;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern5 V=PSOLID COLOR=CX8C411C;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern6 V=PSOLID COLOR=CX99FFFF;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern7 V=PSOLID COLOR=CX9999FF;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern8 V=PSOLID COLOR=CXFFFF99;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern9 V=PSOLID COLOR=CX999999;&lt;BR /&gt;
MPRINT(PATTERNSTATEMENTS):   pattern10 V=PSOLID COLOR=CX99FF99;&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Lu</description>
      <pubDate>Mon, 11 Oct 2010 20:13:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/color-rotation-in-pie-chart/m-p/15378#M298</guid>
      <dc:creator>lueryy2000</dc:creator>
      <dc:date>2010-10-11T20:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: color rotation in pie chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/color-rotation-in-pie-chart/m-p/15379#M299</link>
      <description>The main problem is that you'll want to *not* have the _n_ in quotes, when you're looping through creating your macro variables with symput.  You'll also probably want to sort your data set, to guarantee that the pattern statements match up with the order the items will appear in the legend.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=temp out=temp;&lt;BR /&gt;
by group;&lt;BR /&gt;
run;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   set temp;&lt;BR /&gt;
   CALL SYMPUT('SliceColor'||TRIM(LEFT(_N_)),TRIM(LEFT(COLOR)));&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
%MACRO PatternStatements;&lt;BR /&gt;
    %DO i=1 %TO 10;&lt;BR /&gt;
	   pattern&amp;amp;i V=PSOLID COLOR=&amp;amp;&amp;amp;SliceColor&amp;amp;i;&lt;BR /&gt;
	%END;&lt;BR /&gt;
%MEND;&lt;BR /&gt;
%PatternStatements;&lt;BR /&gt;
&lt;BR /&gt;
title "&amp;amp;slicecolor1 &amp;amp;slicecolor2";&lt;BR /&gt;
PROC GCHART DATA=temp;&lt;BR /&gt;
    PIE group / SUMVAR=COUNT &lt;BR /&gt;
NOHEADING &lt;BR /&gt;
SLICE=OUTSIDE &lt;BR /&gt;
VALUE=NONE &lt;BR /&gt;
PERCENT=NONE &lt;BR /&gt;
DESCENDING &lt;BR /&gt;
legend&lt;BR /&gt;
OTHER=0; &lt;BR /&gt;
RUN; QUIT;</description>
      <pubDate>Tue, 12 Oct 2010 13:17:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/color-rotation-in-pie-chart/m-p/15379#M299</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-10-12T13:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: color rotation in pie chart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/color-rotation-in-pie-chart/m-p/15380#M300</link>
      <description>Ooops, I made such a silly mistake. Now it works perfectly. Thank you very much for your help and suggestion.&lt;BR /&gt;
Lu</description>
      <pubDate>Tue, 12 Oct 2010 13:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/color-rotation-in-pie-chart/m-p/15380#M300</guid>
      <dc:creator>lueryy2000</dc:creator>
      <dc:date>2010-10-12T13:34:19Z</dc:date>
    </item>
  </channel>
</rss>

