<?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 proc gchart for pie charts in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/591124#M18902</link>
    <description>&lt;P&gt;Dear Robert,&lt;/P&gt;&lt;P&gt;This is a very helpful programme.&lt;/P&gt;&lt;P&gt;Is it possible to do the same with "proc template; define statgraph pie" ?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Kim&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2019 10:37:47 GMT</pubDate>
    <dc:creator>Kimi2</dc:creator>
    <dc:date>2019-09-24T10:37:47Z</dc:date>
    <item>
      <title>using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/404748#M13826</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;Is there any way to roundup the percentage values in a pie chart. I don't want any decimal points to be displayed. Also I want the title bold and will like to display all slices even those below 0%. I dont want them to be labelled other.&lt;/P&gt;&lt;P&gt;I used other =0 but still have not the appropriate results. I will appreciate any help. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 11:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/404748#M13826</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2017-10-17T11:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/404756#M13828</link>
      <description>&lt;P&gt;You should be able to apply a format directly to it, for example:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/877.html" target="_blank"&gt;http://support.sas.com/kb/24/877.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 12:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/404756#M13828</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-17T12:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/404958#M13830</link>
      <description>&lt;P&gt;proc format is not changing the decimal point&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pie.jpg" style="width: 156px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15963i887283D67E1B7313/image-size/large?v=v2&amp;amp;px=999" role="button" title="pie.jpg" alt="pie.jpg" /&gt;&lt;/span&gt;&amp;nbsp; a similar chart of what I have. I do not want any decimals&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;goptions  border htitle=12pt htext=10pt;


pattern1 color=red;
pattern2 color=green;
pattern3 color=orange;
pattern4 color=purple;


proc format;
   percent pctfmt (round) 0-high='000%';
run;

/* Define a legend */

legend1 label=("my pie")

position=(bottom )

offset=(4,)

across=1

value=(color=black)

shape=bar(4,1.5);



proc gchart data=pie;

title "my pie chart";

pie cars /sumvar= percent

clockwise value=none

legend=legend1

percent=inside

radius=25

noheading;

 format percent pctfmt.;   


run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;please help I want only intergers without any decimal places&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2017 19:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/404958#M13830</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2017-10-17T19:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/405181#M13847</link>
      <description>&lt;P&gt;I don't think your user-defined-format is running correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
   percent pctfmt &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;round&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;high&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'000%'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&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;When I try to run it, I get the following error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;237 proc format;&lt;BR /&gt;238 percent pctfmt (round) 0-high='000%';&lt;BR /&gt; -------&lt;BR /&gt; 180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;
&lt;P&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;239 run;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 12:32:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/405181#M13847</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2017-10-18T12:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/405187#M13849</link>
      <description>&lt;P&gt;If you were letting Gchart calculate the percent values, I don't think you can control the format (number of decimal places).&lt;/P&gt;
&lt;P&gt;But since it appears you're pre-calculating the values of the percent variable, you should be able to control the number of decimal places with a format statement. Rather than writing your own user-defined-format, I would recommend just using the sas-supplied percent format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some code that shows letting Gchart calculate the percent (where you can't control the format), and then pre-calculating the percent value (where you can control it with SAS' percent format):&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;title "Using automatically-calculated percent";&lt;BR /&gt;title2 "(can't control format)";&lt;BR /&gt;proc gchart data=shoes_summarized;&lt;BR /&gt;pie region / type=sum sumvar=sales percent=outside value=none noheading other=0;&lt;BR /&gt;run;&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="pie1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15987i2798E0AD3B16508A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pie1.png" alt="pie1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql noprint;&lt;BR /&gt;create table shoes_summarized as &lt;BR /&gt;select unique region, sum(sales) as sales&lt;BR /&gt;from sashelp.shoes&lt;BR /&gt;group by region;&lt;BR /&gt;create table shoes_summarized as&lt;BR /&gt;select unique region, sales, sum(sales) as total_sales&lt;BR /&gt;from shoes_summarized;&lt;BR /&gt;quit; run;&lt;BR /&gt;data shoes_summarized; set shoes_summarized;&lt;BR /&gt;percent=sales/total_sales;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;title "Using manually pre-calculated percent";&lt;BR /&gt;title2 "(can control format)";&lt;BR /&gt;proc gchart data=shoes_summarized;&lt;BR /&gt;format percent percent7.0;&lt;BR /&gt;pie region / type=sum sumvar=percent value=outside slice=none noheading other=0;&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="pie2.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15988iBBA39B1C2F75E9AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pie2.png" alt="pie2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 12:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/405187#M13849</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2017-10-18T12:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/405347#M13856</link>
      <description>&lt;P&gt;Okay thanks a lot, I will try your suggetions and leave a feedback.&lt;/P&gt;&lt;P&gt;I probably can't control this because gchart is calculating the percent for me.&lt;/P&gt;&lt;P&gt;Thanks for the idea.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 20:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/405347#M13856</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2017-10-18T20:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/406488#M13882</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp; RobertAllison_S, your suggested method did work. It looks very nice&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 12:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/406488#M13882</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2017-10-23T12:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/591124#M18902</link>
      <description>&lt;P&gt;Dear Robert,&lt;/P&gt;&lt;P&gt;This is a very helpful programme.&lt;/P&gt;&lt;P&gt;Is it possible to do the same with "proc template; define statgraph pie" ?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Kim&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 10:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/591124#M18902</guid>
      <dc:creator>Kimi2</dc:creator>
      <dc:date>2019-09-24T10:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: using proc gchart for pie charts</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/591170#M18905</link>
      <description>&lt;P&gt;The second approach from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;&amp;nbsp;should also work for PIECHART in ODS Graphics. Just put your FORMAT statement with the PROC SGRENDER call.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 14:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/using-proc-gchart-for-pie-charts/m-p/591170#M18905</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-09-24T14:37:54Z</dc:date>
    </item>
  </channel>
</rss>

