<?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: Possible bug in proc sgpie in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989292#M25937</link>
    <description>&lt;P&gt;That is because percent for 15,20,25 are way too small when 1/1000=0.001 .&lt;/P&gt;
&lt;P&gt;But the percent is not small when 1/50=0.02 .&lt;/P&gt;
&lt;P&gt;Since PIE graph stands for percent, so you could see the slice is very thin and datalabel of them are overlapped (See my graph).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two ways you could try:&lt;/P&gt;
&lt;P&gt;1) Using my code and print label "10 1 , 15 1 , 20 1" by sganno dataset.&lt;/P&gt;
&lt;P&gt;2)Using your code and&amp;nbsp;&amp;nbsp;print label "5 1000" by sganno dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data pie1;
	do i=1 to 1000;
		v=5;
		output;
	end;
	v=10;
	output;
	v=15;
	output;
	v=20;
	output;
run;

&lt;STRONG&gt;data pie2;
 set pie1;
 if _n_ &amp;lt; 951 then delete; 
run;&lt;/STRONG&gt;


%sganno
data sganno;
%SGTEXT(
     &lt;STRONG&gt;LABEL="5       1000",&lt;/STRONG&gt;
     DRAWSPACE="GRAPHPERCENT" ,
     TEXTCOLOR="black" ,
	 FILLCOLOR="white",
	 FILLTRANSPARENCY=0,
     WIDTH=8,
     X1=83,
     Y1=48,
	 id='pie'
     )
run;

proc template;
define statgraph simplepie;
begingraph;
entrytitle "Car Models by Origin";
layout region;
piechart category=v / datalabellocation=callout LABELFITPOLICY=NONE
 OTHERSLICE=FALSE CENTERFIRSTSLICE=TRUE  OUTLINEATTRS=(thickness=0);
endlayout; 
annotate /id='pie';

endgraph;
end;
run;
proc sgrender data=&lt;STRONG&gt;pie2&lt;/STRONG&gt; &lt;STRONG&gt;sganno=sganno&lt;/STRONG&gt;
template=simplepie;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1780642268435.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/115690i9C14C17F1976C602/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1780642268435.png" alt="Ksharp_0-1780642268435.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jun 2026 09:48:44 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2026-06-05T09:48:44Z</dc:date>
    <item>
      <title>Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989174#M25929</link>
      <description>&lt;P&gt;Hi. When I run the following code...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pie1;
	do i=1 to 1000;
		v=5;
		output;
	end;
	v=10;
	output;
	v=15;
	output;
	v=20;
	output;
run;

ods listing gpath='/home/xxx/AHAGM/images';
ods graphics / imagename="pie1" imagefmt=png;
title "pie1";

proc sgpie data=pie1;
	pie v / otherpercent=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get this result. My understanding is that using "otherpercent=0" should cause all slices to appear and be labelled.&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="sas1.jpg" style="width: 818px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/115628i8D41322297E83B48/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas1.jpg" alt="sas1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2026 16:48:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989174#M25929</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2026-06-03T16:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989178#M25930</link>
      <description>&lt;P&gt;I think you need to specify the label with OTHERLABEL&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pie1;
	do i=1 to 1000;
		v=5;
		output;
	end;
	v=10;
	output;
	v=15;
	output;
	v=20;
	output;
run;

*ods listing gpath='/home/xxx/AHAGM/images';
*ods graphics / imagename="pie1" imagefmt=png;
*title "pie1";

proc sgpie data=pie1;
	pie v / otherpercent=1 otherlabel='Other';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-06-03 133658.png" style="width: 642px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/115630iA1A5BABF019268ED/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-06-03 133658.png" alt="Screenshot 2026-06-03 133658.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2026 18:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989178#M25930</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2026-06-03T18:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989187#M25931</link>
      <description>&lt;P&gt;No, what I'm trying to get is a slice for every value of v...so it should be count 1000 for 5, and count 1 for 10, 15, and 20. Instead, I'm only getting a count of 1 for 20.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2026 00:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989187#M25931</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2026-06-04T00:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989212#M25932</link>
      <description>&lt;P&gt;You could try GTL. It looks like GTL have better control.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data pie1;
	do i=1 to 1000;
		v=5;
		output;
	end;

	v=10;
	output;
	v=15;
	output;
	v=20;
	output;


run;


proc template;
define statgraph simplepie;
begingraph;
entrytitle "Car Models by Origin";
layout region;
piechart category=v / datalabellocation=outside OTHERSLICE=FALSE LABELFITPOLICY=NONE OUTLINEATTRS=(thickness=0);
endlayout;
endgraph;
end;
run;
proc sgrender data=pie1
template=simplepie;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1780554181108.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/115655iC4F229EE841109C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1780554181108.png" alt="Ksharp_0-1780554181108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2026 06:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989212#M25932</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-06-04T06:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989286#M25935</link>
      <description>&lt;P&gt;When I run it I'm still only getting one slice for v=5, size 1,000, and one slice for v=20, size 1. If I dial the count for v=5 back to 50, all of the slices show up. I want them to appear when v=1,000.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pie1;
	do i=1 to 50;
		v=5;
		output;
	end;
	v=10;
	output;
	v=15;
	output;
	v=20;
	output;
run;

ods listing gpath='/home/xxx/AHAGM/images';
ods graphics / imagename="pie1" imagefmt=png;
title "pie1";

proc sgpie data=pie1;
	pie v / otherpercent=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas2.jpg" style="width: 809px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/115688iF9432DA6BEF96754/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas2.jpg" alt="sas2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2026 21:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989286#M25935</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2026-06-04T21:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989287#M25936</link>
      <description>&lt;P&gt;So part of the problem is that you cannot divide the pie into an infinite number of slices.&lt;/P&gt;
&lt;P&gt;I am not sure what the physical limit is but since you are asking for a pie with 1,003 slices we can probably assume it is less than 1000.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2026 23:35:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989287#M25936</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-06-04T23:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989292#M25937</link>
      <description>&lt;P&gt;That is because percent for 15,20,25 are way too small when 1/1000=0.001 .&lt;/P&gt;
&lt;P&gt;But the percent is not small when 1/50=0.02 .&lt;/P&gt;
&lt;P&gt;Since PIE graph stands for percent, so you could see the slice is very thin and datalabel of them are overlapped (See my graph).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two ways you could try:&lt;/P&gt;
&lt;P&gt;1) Using my code and print label "10 1 , 15 1 , 20 1" by sganno dataset.&lt;/P&gt;
&lt;P&gt;2)Using your code and&amp;nbsp;&amp;nbsp;print label "5 1000" by sganno dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data pie1;
	do i=1 to 1000;
		v=5;
		output;
	end;
	v=10;
	output;
	v=15;
	output;
	v=20;
	output;
run;

&lt;STRONG&gt;data pie2;
 set pie1;
 if _n_ &amp;lt; 951 then delete; 
run;&lt;/STRONG&gt;


%sganno
data sganno;
%SGTEXT(
     &lt;STRONG&gt;LABEL="5       1000",&lt;/STRONG&gt;
     DRAWSPACE="GRAPHPERCENT" ,
     TEXTCOLOR="black" ,
	 FILLCOLOR="white",
	 FILLTRANSPARENCY=0,
     WIDTH=8,
     X1=83,
     Y1=48,
	 id='pie'
     )
run;

proc template;
define statgraph simplepie;
begingraph;
entrytitle "Car Models by Origin";
layout region;
piechart category=v / datalabellocation=callout LABELFITPOLICY=NONE
 OTHERSLICE=FALSE CENTERFIRSTSLICE=TRUE  OUTLINEATTRS=(thickness=0);
endlayout; 
annotate /id='pie';

endgraph;
end;
run;
proc sgrender data=&lt;STRONG&gt;pie2&lt;/STRONG&gt; &lt;STRONG&gt;sganno=sganno&lt;/STRONG&gt;
template=simplepie;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1780642268435.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/115690i9C14C17F1976C602/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1780642268435.png" alt="Ksharp_0-1780642268435.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2026 09:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989292#M25937</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2026-06-05T09:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989317#M25941</link>
      <description>&lt;P&gt;Yes, I think that's the only solution. I asked for a clarification from Tech Support, it'll be interesting to see what they say.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2026 17:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989317#M25941</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2026-06-05T17:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Possible bug in proc sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989343#M25942</link>
      <description>&lt;P&gt;So the answer is to display a pie chart where the size of the slices is wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2026 01:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Possible-bug-in-proc-sgpie/m-p/989343#M25942</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-06-08T01:08:45Z</dc:date>
    </item>
  </channel>
</rss>

