<?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 Proc gchart pie chart rounding percents in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607432#M19158</link>
    <description>&lt;P&gt;Hello all, first time poster here. I am successfully getting a pie chart output with proc gchart in SAS 9.4, but I'd like to round the percents to whole numbers, but I cannot find an option to do this within proc gchart from researching online.&amp;nbsp; The codes and outputs follow below. I am still a rather beginner SAS user, so perhaps there are other ways. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Pie chart - Time Living in the US if Born Outside US.*/
title1 'Time Living in the US if Born Outside US';
proc gchart data=cohortb2019_Q2;
pie years_group    /*variable*/ 
/ 
type=freq            /*Statistic being analyzed. In this case, it's counts*/
percent=inside       /*Adds percent inside pie chart*/
radius=25            /*Size of the pie chart*/
woutline=1           /*Size of outline*/
angle=100            /*Angle of the pie chart*/
coutline=white       /*Color of pie lines*/
plabel=
	(height=1.4  /*Size of text*/ 
	 color=black /*Color of text*/
	 font='Georgia/bold') /*Font*/
noheading;           /*Excludes the heading that indicates what variables are being run*/
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output is:&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="gchart5.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34257i97224B6DA1C40083/image-size/large?v=v2&amp;amp;px=999" role="button" title="gchart5.png" alt="gchart5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'd like the percents to be 27%, 18%, etc. (rounded). I also have a frequency table code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Outputs frequencies for country of origin (birth).*/
proc freq data=cohortb2019_Q2;
tables born_abroad country_born /missing;
title 'Born Abroad?';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the output being:&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="Capture.JPG" style="width: 419px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34258iB280BAE9586EE5FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2019 17:07:35 GMT</pubDate>
    <dc:creator>vegan_renegade</dc:creator>
    <dc:date>2019-11-26T17:07:35Z</dc:date>
    <item>
      <title>Proc gchart pie chart rounding percents</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607432#M19158</link>
      <description>&lt;P&gt;Hello all, first time poster here. I am successfully getting a pie chart output with proc gchart in SAS 9.4, but I'd like to round the percents to whole numbers, but I cannot find an option to do this within proc gchart from researching online.&amp;nbsp; The codes and outputs follow below. I am still a rather beginner SAS user, so perhaps there are other ways. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Pie chart - Time Living in the US if Born Outside US.*/
title1 'Time Living in the US if Born Outside US';
proc gchart data=cohortb2019_Q2;
pie years_group    /*variable*/ 
/ 
type=freq            /*Statistic being analyzed. In this case, it's counts*/
percent=inside       /*Adds percent inside pie chart*/
radius=25            /*Size of the pie chart*/
woutline=1           /*Size of outline*/
angle=100            /*Angle of the pie chart*/
coutline=white       /*Color of pie lines*/
plabel=
	(height=1.4  /*Size of text*/ 
	 color=black /*Color of text*/
	 font='Georgia/bold') /*Font*/
noheading;           /*Excludes the heading that indicates what variables are being run*/
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output is:&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="gchart5.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34257i97224B6DA1C40083/image-size/large?v=v2&amp;amp;px=999" role="button" title="gchart5.png" alt="gchart5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I'd like the percents to be 27%, 18%, etc. (rounded). I also have a frequency table code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Outputs frequencies for country of origin (birth).*/
proc freq data=cohortb2019_Q2;
tables born_abroad country_born /missing;
title 'Born Abroad?';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And the output being:&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="Capture.JPG" style="width: 419px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34258iB280BAE9586EE5FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 17:07:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607432#M19158</guid>
      <dc:creator>vegan_renegade</dc:creator>
      <dc:date>2019-11-26T17:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gchart pie chart rounding percents</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607448#M19159</link>
      <description>If you can switch to SGPIE there's the statfmt that allows you to specify the format of the variable.</description>
      <pubDate>Tue, 26 Nov 2019 17:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607448#M19159</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-26T17:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gchart pie chart rounding percents</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607821#M19162</link>
      <description>&lt;P&gt;If you're wanting to have complete control over the format of the value shown in a Gchart pie chart, I would recommend pre-calculating your statistic, and then only showing that 1 value on the pie. For example...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data summarized;&lt;BR /&gt;length country $20;&lt;BR /&gt;input my_pct country;&lt;BR /&gt;datalines;&lt;BR /&gt;.2727 Philippines&lt;BR /&gt;.1818 USA&lt;BR /&gt;.0909 China&lt;BR /&gt;.0909 Eritrea&lt;BR /&gt;.0909 Guam&lt;BR /&gt;.1818 Mexico&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title1 'Time Living in the US if Born Outside US';&lt;BR /&gt;proc gchart data=summarized;&lt;BR /&gt;format my_pct percent7.0;&lt;BR /&gt;pie country /&lt;BR /&gt;type=sum sumvar=my_pct&lt;BR /&gt;value=inside&lt;BR /&gt;radius=25&lt;BR /&gt;woutline=1&lt;BR /&gt;angle=100&lt;BR /&gt;coutline=white&lt;BR /&gt;plabel=(height=1.4 color=black font='Georgia/bold')&lt;BR /&gt;noheading;&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="pie.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/34297i315CE85066F691C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pie.png" alt="pie.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 19:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607821#M19162</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2019-11-27T19:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gchart pie chart rounding percents</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607931#M19163</link>
      <description>&lt;P&gt;Thank you, I actually tried using a percent format just like you did here, but the problem is it makes my counts disappear in the pie chart (see my original post, it shows the counts). I want the counts to stay.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2019 05:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/607931#M19163</guid>
      <dc:creator>vegan_renegade</dc:creator>
      <dc:date>2019-11-29T05:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc gchart pie chart rounding percents</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/609362#M19190</link>
      <description>&lt;P&gt;Yep - that's where the "&lt;SPAN&gt;only showing that 1 value on the pie" caveat comes in. &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;</description>
      <pubDate>Wed, 04 Dec 2019 13:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-gchart-pie-chart-rounding-percents/m-p/609362#M19190</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2019-12-04T13:05:18Z</dc:date>
    </item>
  </channel>
</rss>

