<?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: Using DISCRETEATTRMAP in GTL pie chart in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567673#M159665</link>
    <description>&lt;P&gt;When I remove it, I get the wedges, but not the desired colors. It's as if I can't get the format to be picked up by the attribute values.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGRender30.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30429i786AD4620D200A87/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGRender30.png" alt="SGRender30.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2019 15:51:18 GMT</pubDate>
    <dc:creator>svh</dc:creator>
    <dc:date>2019-06-20T15:51:18Z</dc:date>
    <item>
      <title>Using DISCRETEATTRMAP in GTL pie chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567663#M159659</link>
      <description>&lt;P&gt;Hello, I am trying to use GTL to make a template for a series of pie charts (I know, I know) that are needed for my org. I am trying to use the DISCRETEATTRMAP statement to ensure that certain levels retain the same colors in the pie chart. (People will be viewing lots of these, so I need consistency across charts). The variables in my data set are numeric, and I am using a format to bin them into categories. The desired output is a pie chart with wedges, but this code is making concentric circles and is not applying the colors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read the documentation that I can find but am still stumped about where I'm going wrong. If I remove the GROUP statement, I get a pie chart with wedges, but not with the correct colors. Any tips would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input x @@;
datalines;
1 2 2 3 3 3 4 4 4 4 6 6 6 6 6 6 6 7 7 7 5 5 4 4 3 3 
;
run;


** Load the binning format ;
proc format;
  value bin
  1 = 'Never'
  2 = 'Once or Twice'
  3 - 7 = 'Multiple Times'
  ;

proc template;
   define statgraph pie2;
      begingraph;
	     entrytitle "Overall";
		 discreteattrmap name='colors' /ignorecase=true;  ** This is where things are going wrong. ;
                    value 'Never' / fillattrs= (color=green) ;
                    value 'Once or Twice' / fillattrs= (color=yellow) ;
                    value 'Multiple Times'/ fillattrs= (color=red);
                  enddiscreteattrmap ;
		     discreteattrvar attrvar=classfill var=x attrmap='colors';
	     layout region;
            piechart category = x /
	    stat = pct
            datalabellocation = inside
            categorydirection = clockwise
            start = 180 
            name = 'pie'
  	    group = classfill;
            discretelegend 'pie' 
            ;
         endlayout;
      endgraph;
   end;
run;
proc sgrender data = test 
            template = pie2;
			format x bin.;  
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jun 2019 15:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567663#M159659</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2019-06-20T15:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using DISCRETEATTRMAP in GTL pie chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567670#M159663</link>
      <description>&lt;P&gt;The&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;group&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; classfill&lt;/P&gt;
&lt;P&gt;is what makes the concentric rings.&lt;/P&gt;
&lt;P&gt;Try removing it and see if the result is as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 15:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567670#M159663</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-20T15:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using DISCRETEATTRMAP in GTL pie chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567673#M159665</link>
      <description>&lt;P&gt;When I remove it, I get the wedges, but not the desired colors. It's as if I can't get the format to be picked up by the attribute values.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGRender30.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30429i786AD4620D200A87/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGRender30.png" alt="SGRender30.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 15:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567673#M159665</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2019-06-20T15:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using DISCRETEATTRMAP in GTL pie chart</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567712#M159680</link>
      <description>&lt;P&gt;Removing group was the first step. I also&amp;nbsp;needed to change the attrvar= to attrvar=x. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
   define statgraph pie4;
      begingraph;
	     entrytitle "Overall";
		 discreteattrmap name='colors' /ignorecase=true;  ** This is where things are going wrong. ;
   value 'Never' / fillattrs= (color=green) ;
   value 'Once or Twice' / fillattrs= (color=yellow) ;
   value 'Multiple Times'/ fillattrs= (color=red);
         enddiscreteattrmap ;
		 discreteattrvar attrvar=x var=x attrmap='colors';
	     layout region;
            piechart category = x /
			stat = pct
            datalabellocation = inside
            categorydirection = clockwise
            start = 180 
            name = 'pie'
  			;
            discretelegend 'pie' 
            ;
         endlayout;
      endgraph;
   end;
run;
proc sgrender data = test 
            template = pie4;
			format x bin.;  
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:08:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-DISCRETEATTRMAP-in-GTL-pie-chart/m-p/567712#M159680</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2019-06-20T17:08:53Z</dc:date>
    </item>
  </channel>
</rss>

