<?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: How to program the colors of your pie chart? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514283#M17443</link>
    <description>&lt;P&gt;OK, I think I've got it now. Pattern1 sets the fill, the colors then cycle through the 3 available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;goptions colors=(red yellow green);
pattern1 value = solid;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 18 Nov 2018 20:15:19 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2018-11-18T20:15:19Z</dc:date>
    <item>
      <title>How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514251#M17440</link>
      <description>&lt;P&gt;Hey guys&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do a Pie figure with SAS on demand. &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I get a pie with the right color? I mean, a pie showing the green, when the color of my category variable is green, red when the color is red, etc. I have tried the code below, but it doesn´t work. &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you in advance for your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Pie chart*/&lt;/P&gt;&lt;P&gt;Data mydata;&lt;/P&gt;&lt;P&gt;Input Color $ Quantity;&lt;/P&gt;&lt;P&gt;Datalines;&lt;/P&gt;&lt;P&gt;Red 10&lt;/P&gt;&lt;P&gt;Yellow 40&lt;/P&gt;&lt;P&gt;Green 50&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;title1'colors of my pie';&lt;/P&gt;&lt;P&gt;pattern1&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;color=red;&lt;/P&gt;&lt;P&gt;pattern2&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;color=yellow;&lt;/P&gt;&lt;P&gt;pattern3&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;color=green;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;title1 'My pie';&lt;/P&gt;&lt;P&gt;proc gchart data=mydata;&lt;/P&gt;&lt;P&gt;pie color/ type=sum sumvar=Quantity noheader slice=outside value=inside;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 16:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514251#M17440</guid>
      <dc:creator>leonoramillan</dc:creator>
      <dc:date>2018-11-18T16:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514275#M17441</link>
      <description>&lt;P&gt;Try adding this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;goptions colors=(red yellow green);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Nov 2018 19:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514275#M17441</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-11-18T19:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514280#M17442</link>
      <description>&lt;P&gt;Thank you SASKiwi. I tried both&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;goptions&lt;/SPAN&gt; colors&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;red yellow green&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;goptions&lt;/SPAN&gt; colors&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(green&lt;/SPAN&gt; yellow yellow&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first option shows the red, yellow and green colors, but not in the desired match. The second one matched the colors. BUT, how can I program (ex-ante) a specific observation of the category with a color? &amp;nbsp;Options colors=( ) seems to work&amp;nbsp;randomly?&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 19:59:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514280#M17442</guid>
      <dc:creator>leonoramillan</dc:creator>
      <dc:date>2018-11-18T19:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514283#M17443</link>
      <description>&lt;P&gt;OK, I think I've got it now. Pattern1 sets the fill, the colors then cycle through the 3 available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;goptions colors=(red yellow green);
pattern1 value = solid;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Nov 2018 20:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514283#M17443</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-11-18T20:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514285#M17444</link>
      <description>&lt;P&gt;I got this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mypie.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25029iEF2AD44919E42B2D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Mypie.png" alt="Mypie.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 20:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514285#M17444</guid>
      <dc:creator>leonoramillan</dc:creator>
      <dc:date>2018-11-18T20:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514292#M17445</link>
      <description>&lt;P&gt;This gets the order right for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data mydata;
Input Color $ Quantity;
Datalines;
Red 10
Yellow 40
Green 50
;
run;
  
title1'colors of my pie';
goptions colors=(red yellow green);
pattern1 value = solid;
 
title1 'My pie';
proc gchart data=mydata;
pie color/ type=sum sumvar=Quantity noheader slice=outside value=inside
          midpoints = 'Red' 'Yellow' 'Green';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Nov 2018 20:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514292#M17445</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-11-18T20:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514294#M17446</link>
      <description>&lt;P&gt;The full answer is the slices print in alphabetic order regardless of your colour list. The MIDPOINTS option changes the slice order to match the colour order you want.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Nov 2018 20:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514294#M17446</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-11-18T20:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514295#M17447</link>
      <description>Thank you very much SASKiwi. It worked &lt;span class="lia-unicode-emoji" title=":ok_hand:"&gt;👌&lt;/span&gt;</description>
      <pubDate>Sun, 18 Nov 2018 20:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514295#M17447</guid>
      <dc:creator>leonoramillan</dc:creator>
      <dc:date>2018-11-18T20:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to program the colors of your pie chart?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514735#M17462</link>
      <description>&lt;P&gt;Here's a slightly different way of doing it - changing the order of the colors in the pattern statements, to match the alphabetical order of the colors (or whatever variable you're using for the slices).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;goptions xpixels=500 ypixels=500;&lt;BR /&gt;goptions htitle=14pt htext=11pt ftext='albany amt/bold';&lt;/P&gt;
&lt;P&gt;Data mydata;&lt;BR /&gt;Input Color $ Quantity;&lt;BR /&gt;Datalines;&lt;BR /&gt;Red 10&lt;BR /&gt;Yellow 40&lt;BR /&gt;Green 50&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;title1'colors of my pie';&lt;BR /&gt;pattern1 color=green;&lt;BR /&gt;pattern2 color=red;&lt;BR /&gt;pattern3 color=yellow;&lt;/P&gt;
&lt;P&gt;title1 'My pie';&lt;BR /&gt;proc gchart data=mydata;&lt;BR /&gt;pie color/ type=sum sumvar=Quantity noheader slice=outside value=inside;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pie_color.png" style="width: 500px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25080i387B56F792D2CC17/image-size/large?v=v2&amp;amp;px=999" role="button" title="pie_color.png" alt="pie_color.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 12:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-program-the-colors-of-your-pie-chart/m-p/514735#M17462</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2018-11-20T12:59:39Z</dc:date>
    </item>
  </channel>
</rss>

