<?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 Re: Color Pie Slices in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/261472#M9435</link>
    <description>&lt;P&gt;You can use a discrete attrmap to do it. Here is a simple example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define statgraph pie;
begingraph;
discreteattrmap name="gender";
   value "F" / fillattrs=(color=pink);
   value "M" / fillattrs=(color=lightblue);
enddiscreteattrmap;
discreteattrvar attrvar=gender var=sex attrmap="gender";
layout region;
  piechart category=gender response=height;
endlayout;
endgraph;
end;
run;

proc sgrender data=sashelp.class template=pie; run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The attrmap can also be defined in a data set instead of the template, depending on the SAS version you are using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2016 16:53:55 GMT</pubDate>
    <dc:creator>DanH_sas</dc:creator>
    <dc:date>2016-04-05T16:53:55Z</dc:date>
    <item>
      <title>Color Pie Slices</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/261471#M9434</link>
      <description>&lt;P&gt;Good Afternoon, I am looking to set the colors of each individual pice slice based on the catagory value (Alignment).&amp;nbsp; Is there a means to do or control this.&amp;nbsp; Below is a example of the code I am utilizing.&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;TEMPLATE&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DEFINE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;STATGRAPH&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; PIPEPIE;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BEGINGRAPH&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ENTRYTITLE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Current Pipeline Distribution'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ENTRYFOOTNOTE&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;' As of '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;layout&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; region;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;&lt;FONT color="#ff0000" face="Courier New" size="3"&gt;piechart&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; category=Alignment response=PERCENT1 &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;/ dataskin=crisp datalabellocation=outside;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;endlayout&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;endgraph&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;SGRENDER&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DATA&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=WORK.PIPE_PIE1 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;template&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=PIPEPIE;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 16:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/261471#M9434</guid>
      <dc:creator>BLarson</dc:creator>
      <dc:date>2016-04-05T16:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Color Pie Slices</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/261472#M9435</link>
      <description>&lt;P&gt;You can use a discrete attrmap to do it. Here is a simple example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define statgraph pie;
begingraph;
discreteattrmap name="gender";
   value "F" / fillattrs=(color=pink);
   value "M" / fillattrs=(color=lightblue);
enddiscreteattrmap;
discreteattrvar attrvar=gender var=sex attrmap="gender";
layout region;
  piechart category=gender response=height;
endlayout;
endgraph;
end;
run;

proc sgrender data=sashelp.class template=pie; run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The attrmap can also be defined in a data set instead of the template, depending on the SAS version you are using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 16:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/261472#M9435</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2016-04-05T16:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Color Pie Slices</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/261491#M9436</link>
      <description>&lt;P&gt;That certainly did.&amp;nbsp; Thank you very much.&amp;nbsp; My problem was in the ctagory assignment in the layout region.&amp;nbsp; You example helped me figure that out.&amp;nbsp; Thank you again.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 18:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/261491#M9436</guid>
      <dc:creator>BLarson</dc:creator>
      <dc:date>2016-04-05T18:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Color Pie Slices</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/294618#M10376</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm new both to SAS and SAS communities. I use SAS 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to plot multiple pie charts on one page under each other and I need all pies and legends to be centered. I managed to do that with GCHART using ORIGIN option in legend and RADIUS option in pie statement. Now the distance between one pie and corresponding legend is always the same (independently of the group format - when the image size is sufficient) and all pies are the same size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next I needed consistent colors in case one group was missing from data. I searched a lot, but apparently I couldn't find a solution for GCHART. Therefore I used your GTL suggestion and it works well, **bleep**, the graphics even looks better now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT I can't fix the distance between the pie and the legend nor the position and size of the pie. Can anyone help me with any of these approaches? Using barcharts is out of the question and I'm really desperate..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached two pdf files with the situation i described and really hope there is someone who can help me.&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2016 11:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Color-Pie-Slices/m-p/294618#M10376</guid>
      <dc:creator>kavacs</dc:creator>
      <dc:date>2016-08-28T11:24:20Z</dc:date>
    </item>
  </channel>
</rss>

