<?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 Choose colors for variable values in a pie graph in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296649#M10496</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did a survey to know what people think about my brochure. And i would like to draw a pie with their % good or bad opinion. the variable i want to draw is " Brochure " coded in 1,2,3,4. I would like to choose the color of the pie :&lt;/P&gt;&lt;P&gt;1 = Very good in Green&lt;/P&gt;&lt;P&gt;2= Good in greenyellow&lt;/P&gt;&lt;P&gt;3= satisfying in red&lt;/P&gt;&lt;P&gt;4= not satisfying in Black&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS put me random colors... is it possible to choose each color for each value of the variable drawn in the pie please ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, if you find me a solution &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;PRE&gt;&lt;CODE class=" language-sas"&gt;title1'Readibility of the brochure';
pattern1  color=green;
pattern2  color=greenyellow;
pattern3  color=red;
pattern4  color=black;

proc format;
   value brochure 1='Very Good'
               	            2='Good'
			    3='Satisfying'
			    4='Not Satisfying';
run;

proc gchart data=conso;
PIE brochure/ value=none
              percent=arrow
              slice=arrow
              noheading 
              plabel=(font='Albany AMT/bold' h=1.3 color=depk);
			  format brochure brochure.;
run;
goptions reset=all;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4839iCB7DAF0ECFDF9030/image-size/medium?v=v2&amp;amp;px=-1" alt="SAS - i don't want these colors.JPG" title="SAS - i don't want these colors.JPG" height="260" border="0" width="309" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are the colors that i would like to have.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4840i8F970A4C839A9EA2/image-size/original?v=v2&amp;amp;px=-1" alt="this is what i want (Excel).JPG" title="this is what i want (Excel).JPG" height="237" border="0" width="334" /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12936i16374ECDFDA4790A/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="this is what i want (Excel).JPG" title="this is what i want (Excel).JPG" /&gt;</description>
    <pubDate>Tue, 06 Sep 2016 08:16:37 GMT</pubDate>
    <dc:creator>Foody</dc:creator>
    <dc:date>2016-09-06T08:16:37Z</dc:date>
    <item>
      <title>Choose colors for variable values in a pie graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296649#M10496</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did a survey to know what people think about my brochure. And i would like to draw a pie with their % good or bad opinion. the variable i want to draw is " Brochure " coded in 1,2,3,4. I would like to choose the color of the pie :&lt;/P&gt;&lt;P&gt;1 = Very good in Green&lt;/P&gt;&lt;P&gt;2= Good in greenyellow&lt;/P&gt;&lt;P&gt;3= satisfying in red&lt;/P&gt;&lt;P&gt;4= not satisfying in Black&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS put me random colors... is it possible to choose each color for each value of the variable drawn in the pie please ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, if you find me a solution &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;PRE&gt;&lt;CODE class=" language-sas"&gt;title1'Readibility of the brochure';
pattern1  color=green;
pattern2  color=greenyellow;
pattern3  color=red;
pattern4  color=black;

proc format;
   value brochure 1='Very Good'
               	            2='Good'
			    3='Satisfying'
			    4='Not Satisfying';
run;

proc gchart data=conso;
PIE brochure/ value=none
              percent=arrow
              slice=arrow
              noheading 
              plabel=(font='Albany AMT/bold' h=1.3 color=depk);
			  format brochure brochure.;
run;
goptions reset=all;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4839iCB7DAF0ECFDF9030/image-size/medium?v=v2&amp;amp;px=-1" alt="SAS - i don't want these colors.JPG" title="SAS - i don't want these colors.JPG" height="260" border="0" width="309" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are the colors that i would like to have.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4840i8F970A4C839A9EA2/image-size/original?v=v2&amp;amp;px=-1" alt="this is what i want (Excel).JPG" title="this is what i want (Excel).JPG" height="237" border="0" width="334" /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12936i16374ECDFDA4790A/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="this is what i want (Excel).JPG" title="this is what i want (Excel).JPG" /&gt;</description>
      <pubDate>Tue, 06 Sep 2016 08:16:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296649#M10496</guid>
      <dc:creator>Foody</dc:creator>
      <dc:date>2016-09-06T08:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Choose colors for variable values in a pie graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296658#M10497</link>
      <description>&lt;P&gt;Try the symbol statement with the colour value.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 09:21:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296658#M10497</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-06T09:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Choose colors for variable values in a pie graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296758#M10498</link>
      <description>&lt;P&gt;You can do this with a GTL pie chart and a discrete attrmap. 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="piecolors";
  value "F" / fillattrs=(color=pink);
  value "M" / fillattrs=(color=light_blue);
enddiscreteattrmap;
discreteattrvar attrvar=sex_mapped var=sex attrmap="piecolors";
layout region;
  piechart category=sex_mapped response=weight / datalabelcontent=(category percent)
           datalabelattrs=(size=20pt);
endlayout;
endgraph;
end;

proc sgrender data=sashelp.class template=pie;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Sep 2016 15:00:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296758#M10498</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2016-09-06T15:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Choose colors for variable values in a pie graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296765#M10500</link>
      <description>&lt;P&gt;I would recommend pre-summarizing your data, and specifying a few extra options in your gchart (if you want the slices to start at the 12-o'clock position, and be ordered clockwise). Here is a slightly modified version of your code, and the output:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data conso;&lt;BR /&gt;input brochure val;&lt;BR /&gt;datalines;&lt;BR /&gt;1 .30&lt;BR /&gt;2 .61&lt;BR /&gt;3 .09&lt;BR /&gt;4 .00&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1'Readibility of the brochure';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pattern1 color=green;&lt;BR /&gt;pattern2 color=greenyellow;&lt;BR /&gt;pattern3 color=red;&lt;BR /&gt;pattern4 color=black;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format;&lt;BR /&gt; value brochure 1='Very Good'&lt;BR /&gt; 2='Good'&lt;BR /&gt; 3='Satisfying'&lt;BR /&gt; 4='Not Satisfying';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gchart data=conso;&lt;BR /&gt;PIE brochure/ discrete &lt;BR /&gt; type=sum sumvar=val&lt;BR /&gt; clockwise angle=90 &lt;BR /&gt; value=none percent=arrow slice=arrow noheading &lt;BR /&gt; plabel=(font='Albany AMT/bold' h=1.3 color=depk);&lt;BR /&gt; format brochure brochure.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4845i4B0F5092B0AF8B6E/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="pie.png" title="pie.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2016 15:15:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Choose-colors-for-variable-values-in-a-pie-graph/m-p/296765#M10500</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2016-09-06T15:15:59Z</dc:date>
    </item>
  </channel>
</rss>

