<?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 explode slice Sgpie in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780277#M22314</link>
    <description>&lt;P&gt;This is a pie chart macro that I wrote that allows the user to "explode" out a second piechart with the "Other" categories.&amp;nbsp; I don't know if this is what you are trying to do with a donut chart, but you could add a white circle to the center to make this a donut chart.&amp;nbsp; The code could use refinement but could get you started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The VAR option controls which variable sets the categories.&amp;nbsp; The OTHER_THRESHOLD determines which percentage is considered "Other" (e.g. 5 will take any group &amp;lt;=5% and group it into the Other slice).&amp;nbsp; RADIUS and OTHER_RADIUS determine the size of the circles for the pie chart and OTHER_SHIFT will move the second pie chart over left or right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %pie(data=sashelp.cars,var=type,other_threshold=10);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="_pie.png" style="width: 960px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65716i340397827A85D9F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="_pie.png" alt="_pie.png" /&gt;&lt;/span&gt;&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;%macro pie(data=,var=,other_threshold=5,radius=1,other_radius=0.5,other_shift=2,
    plottype=png,plotname=_pie);
    
    data _temp;
        set &amp;amp;data (keep=&amp;amp;var rename=(&amp;amp;var=_var_t));
        length _var_ $200.;
        if ^missing(strip(vvalue(_var_t))) then _var_=strip(vvalue(_var_t));
        else _var_='Missing';
    run;
    
    proc freq data=_temp noprint;
        table _var_ / out=_frq;
    run;
    
    data _frq2;
        set _frq;
        by _var_;
        if first._var_ then _indx_+1;
    run;
    
    proc sql noprint;
        create table _plota as
            select a.* ,b._var_
            from (select _indx_,sum(percent) as percent from
            (select _var_,ifn(percent lt &amp;amp;other_threshold,.o,_indx_) as _indx_,(percent lt &amp;amp;other_threshold) as other,percent from _frq2)
            group by _indx_) a left join _Frq2 as b on a._indx_=b._indx_;
        create table _plotb as   
            select _var_,_indx_,percent,percent/sum(percent) as ppt,sum(percent) as othpct from _frq2 where percent lt &amp;amp;other_threshold;
        %local _othgrps;
        select count(*) into :_othgrps from _frq where percent lt &amp;amp;other_threshold;
    quit;
    data _plota2 (drop=text xtext ytext) _texta (keep=text xtext ytext);
        set _plota end=last;
        retain endpoint id;
        percent=percent/100;
        if _n_=1 and _indx_^=.o then endpoint=0;
        if _indx_=.o then do;
            id=1;
            text=strip(put(percent*100,12.0))||'%';
            xtext=0.5*cos(0);ytext=1.1*sin(0);output _texta;
            series=1;x=0;y=0;output _plota2;
            series=0;
            do i = (2*constant('pi'))*(-percent/2) to (2*constant('pi'))*(percent/2) by (2*constant('pi'))*(percent/50);
                x=&amp;amp;radius*cos(i);
                y=&amp;amp;radius*sin(i);
                output _plota2;
            end;
            series=1;output _plota2;
            endpoint=percent/2;
        end;
        else do;
            id+1;
            text=strip(put(percent*100,12.0))||'%';
            xtext=0.6*cos(2*constant('pi')*(percent/2+endpoint));ytext=0.6*sin(2*constant('pi')*(percent/2+endpoint));output _texta;
            series=1;x=0;y=0;output _plota2;  
            series=0;
            do i = (2*constant('pi'))*(endpoint) to (2*constant('pi'))*(percent+endpoint) by (2*constant('pi'))*(percent/50);
                x=&amp;amp;radius*cos(i);
                y=&amp;amp;radius*sin(i);
                output _plota2;
            end;
            if last then do;
                series=1;output _plota2;
            end;
            else do;
                series=1;output _plota2;        
            end;
            endpoint=endpoint+percent;
        end;
    run;
    %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do;
        data _links;
            set _plota;
            where _indx_=.o;
            
            link=1;
            xlink=&amp;amp;radius*cos(constant('pi')*percent/100);
            ylink=&amp;amp;radius*sin(constant('pi')*percent/100);
            output;
            xlink=&amp;amp;other_shift+&amp;amp;other_radius*cos(2*constant('pi')/3);
            ylink=&amp;amp;other_radius*sin(2*constant('pi')/3);
            output;
            
            link=2;
            xlink=&amp;amp;radius*cos(constant('pi')*-percent/100);
            ylink=&amp;amp;radius*sin(constant('pi')*-percent/100);
            output;
            xlink=&amp;amp;other_shift+&amp;amp;other_radius*cos(4*constant('pi')/3);
            ylink=&amp;amp;other_radius*sin(4*constant('pi')/3);
            output;
        run;
        data _plotb2(drop=text xtext ytext) _textb (keep=text xtext ytext);
            set _plotb;
            retain endpoint id;
            if _n_=1 then endpoint=0;
            id+1;
            text=strip(put(percent,12.0))||'%';
            xtext=&amp;amp;other_shift+0.5*&amp;amp;other_radius*cos(2*constant('pi')*(ppt/2+endpoint));
            ytext=0.5*&amp;amp;other_radius*sin(2*constant('pi')*(ppt/2+endpoint));output _textb;
            series=1;x=&amp;amp;other_shift;y=0;output _plotb2;  
            series=0;
            do i = (2*constant('pi'))*(endpoint) to (2*constant('pi'))*(ppt+endpoint) by (2*constant('pi'))*(ppt/50);
                x=&amp;amp;other_shift+&amp;amp;other_radius*cos(i);
                y=&amp;amp;other_radius*sin(i);
                output _plotb2;
            end;
            series=1;output _plotb2;
            endpoint=endpoint+ppt;
        run;
    %end;
        
    data _text;
        set _texta %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do; _textb %end;;
    run;
    data _plot;
        set _plota2 (in=a) %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do; _plotb2 (in=b) %end;;
        retain lastid;
        if a then lastid=id;
        else do;
            circle=2;
            id=id+lastid;
        end;
    run;
    
    data _plot;
        merge _plot _text %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do; _links %end;;
    run;
    ods path WORK.TEMPLAT(UPDATE) SASHELP.TMPLMST (READ);
    proc template;
        define statgraph _pie;
        begingraph / 
            
            %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do;
                designheight=5in designwidth=10in
            %end;
            %else %do;
                designheight=5in designwidth=7in
            %end;;
        layout lattice;
            sidebar / align=right;            
                discretelegend 'p1'  / exclude=(' ') location=inside halign=right valign=center border=false across=1 valueattrs=(size=18pt)
                    displayclipped=true autoitemsize=true;
            endsidebar;
            layout overlay / walldisplay=none xaxisopts=(display=none 
                %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do;
                    linearopts=(viewmin=-1.1 viewmax=%sysevalf(&amp;amp;other_shift+&amp;amp;other_radius+0.1))) 
                %end;
                %else %do;
                    linearopts=(viewmin=-1.1 viewmax=1.1)) 
                %end;
                    
                yaxisopts=(display=none linearopts=(viewmin=-1.1 viewmax=1.1));
                /*Left Pie Chart*/
                polygonplot x=eval(ifn(circle^=2,x,.)) y=y id=id / outlineattrs=(color=black pattern=1) display=(fill) group=_var_ name='p1'
                    dataskin=gloss;
                seriesplot x=eval(ifn(series=1 and circle^=2,x,.)) y=y / lineattrs=(color=black pattern=1) group=id;
                DRAWOVAL X=0 Y=0 WIDTH=2 HEIGHT=2 / display=(outline) outlineattrs=(color=black) heightunit=data 
                    drawspace=datavalue widthunit=data;
                    
                /*Right Pie Chart*/
                %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do;
                    polygonplot x=eval(ifn(circle=2,x,.)) y=y id=id / outlineattrs=(color=black pattern=1) display=(fill) group=_var_ dataskin=gloss;
                    seriesplot x=xlink y=ylink / group=link lineattrs=(color=black pattern=1);
                    DRAWOVAL X=&amp;amp;other_shift Y=0 WIDTH=%sysevalf(2*&amp;amp;other_radius) HEIGHT=%sysevalf(2*&amp;amp;other_radius) / display=(outline) outlineattrs=(color=black) heightunit=data 
                        drawspace=datavalue widthunit=data;
                        
                    seriesplot x=eval(ifn(series=1 and circle=2,x,.)) y=y / lineattrs=(color=black pattern=1) group=id;
                %end;
                /*Percentages*/
                textplot x=xtext y=ytext text=text / textattrs=(size=16pt) position=center;
            endlayout;
        endlayout;
        endgraph;
        end;
    run;
    ods graphics / reset scale=off imagename="&amp;amp;plotname" imagefmt=&amp;amp;plottype; 
    proc sgrender data=_plot template=_pie;
    run;
    
    proc datasets nodetails nolist;
       delete _temp _temp2 _plota _plota2 _plotb _plotb2 _links _text _texta _textb  _Frq _frq2;
    quit;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 15 Nov 2021 17:15:39 GMT</pubDate>
    <dc:creator>JeffMeyers</dc:creator>
    <dc:date>2021-11-15T17:15:39Z</dc:date>
    <item>
      <title>How to explode slice Sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780233#M22311</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;is it possible to use explode on sgpie when creating a donut chart?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 14:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780233#M22311</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-11-15T14:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to explode slice Sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780270#M22312</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/168930"&gt;@Anita_n&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks to your question, I have now discovered&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;proc EXPLODE&lt;/P&gt;
&lt;P&gt;, which is completely unrelated to your question by the way.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can only look at the doc and I do not see any "explode" option in&amp;nbsp;DONUT Statement of PROC SGPIE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I am looking at SAS 9.4 M7 doc while t&lt;SPAN style="font-family: inherit;"&gt;he &lt;/SPAN&gt;&lt;FONT style="font-family: inherit;"&gt;SGPIE&lt;/FONT&gt;&lt;SPAN style="font-family: inherit;"&gt; procedure is/was a preproduction feature in the &lt;/SPAN&gt;&lt;SPAN class="xisDoc-codeFocus" style="font-family: inherit;"&gt;SAS 9.4M6&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt; release.&lt;BR /&gt;Maybe if you are using SAS VIYA, more is possible?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 16:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780270#M22312</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-15T16:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to explode slice Sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780273#M22313</link>
      <description>&lt;P&gt;On top of my previous reply (see above message).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use GCHART Procedure with&lt;/P&gt;
&lt;P&gt;PIE, PIE3D, and DONUT Statement&lt;/P&gt;
&lt;P&gt;, you have access to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EXPLODE= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any reason why you would prefer PROC SGPIE over PROC GCHART ??&lt;/P&gt;
&lt;P&gt;If not, use the latter to accomplish what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 17:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780273#M22313</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-15T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to explode slice Sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780277#M22314</link>
      <description>&lt;P&gt;This is a pie chart macro that I wrote that allows the user to "explode" out a second piechart with the "Other" categories.&amp;nbsp; I don't know if this is what you are trying to do with a donut chart, but you could add a white circle to the center to make this a donut chart.&amp;nbsp; The code could use refinement but could get you started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The VAR option controls which variable sets the categories.&amp;nbsp; The OTHER_THRESHOLD determines which percentage is considered "Other" (e.g. 5 will take any group &amp;lt;=5% and group it into the Other slice).&amp;nbsp; RADIUS and OTHER_RADIUS determine the size of the circles for the pie chart and OTHER_SHIFT will move the second pie chart over left or right.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; %pie(data=sashelp.cars,var=type,other_threshold=10);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="_pie.png" style="width: 960px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65716i340397827A85D9F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="_pie.png" alt="_pie.png" /&gt;&lt;/span&gt;&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;%macro pie(data=,var=,other_threshold=5,radius=1,other_radius=0.5,other_shift=2,
    plottype=png,plotname=_pie);
    
    data _temp;
        set &amp;amp;data (keep=&amp;amp;var rename=(&amp;amp;var=_var_t));
        length _var_ $200.;
        if ^missing(strip(vvalue(_var_t))) then _var_=strip(vvalue(_var_t));
        else _var_='Missing';
    run;
    
    proc freq data=_temp noprint;
        table _var_ / out=_frq;
    run;
    
    data _frq2;
        set _frq;
        by _var_;
        if first._var_ then _indx_+1;
    run;
    
    proc sql noprint;
        create table _plota as
            select a.* ,b._var_
            from (select _indx_,sum(percent) as percent from
            (select _var_,ifn(percent lt &amp;amp;other_threshold,.o,_indx_) as _indx_,(percent lt &amp;amp;other_threshold) as other,percent from _frq2)
            group by _indx_) a left join _Frq2 as b on a._indx_=b._indx_;
        create table _plotb as   
            select _var_,_indx_,percent,percent/sum(percent) as ppt,sum(percent) as othpct from _frq2 where percent lt &amp;amp;other_threshold;
        %local _othgrps;
        select count(*) into :_othgrps from _frq where percent lt &amp;amp;other_threshold;
    quit;
    data _plota2 (drop=text xtext ytext) _texta (keep=text xtext ytext);
        set _plota end=last;
        retain endpoint id;
        percent=percent/100;
        if _n_=1 and _indx_^=.o then endpoint=0;
        if _indx_=.o then do;
            id=1;
            text=strip(put(percent*100,12.0))||'%';
            xtext=0.5*cos(0);ytext=1.1*sin(0);output _texta;
            series=1;x=0;y=0;output _plota2;
            series=0;
            do i = (2*constant('pi'))*(-percent/2) to (2*constant('pi'))*(percent/2) by (2*constant('pi'))*(percent/50);
                x=&amp;amp;radius*cos(i);
                y=&amp;amp;radius*sin(i);
                output _plota2;
            end;
            series=1;output _plota2;
            endpoint=percent/2;
        end;
        else do;
            id+1;
            text=strip(put(percent*100,12.0))||'%';
            xtext=0.6*cos(2*constant('pi')*(percent/2+endpoint));ytext=0.6*sin(2*constant('pi')*(percent/2+endpoint));output _texta;
            series=1;x=0;y=0;output _plota2;  
            series=0;
            do i = (2*constant('pi'))*(endpoint) to (2*constant('pi'))*(percent+endpoint) by (2*constant('pi'))*(percent/50);
                x=&amp;amp;radius*cos(i);
                y=&amp;amp;radius*sin(i);
                output _plota2;
            end;
            if last then do;
                series=1;output _plota2;
            end;
            else do;
                series=1;output _plota2;        
            end;
            endpoint=endpoint+percent;
        end;
    run;
    %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do;
        data _links;
            set _plota;
            where _indx_=.o;
            
            link=1;
            xlink=&amp;amp;radius*cos(constant('pi')*percent/100);
            ylink=&amp;amp;radius*sin(constant('pi')*percent/100);
            output;
            xlink=&amp;amp;other_shift+&amp;amp;other_radius*cos(2*constant('pi')/3);
            ylink=&amp;amp;other_radius*sin(2*constant('pi')/3);
            output;
            
            link=2;
            xlink=&amp;amp;radius*cos(constant('pi')*-percent/100);
            ylink=&amp;amp;radius*sin(constant('pi')*-percent/100);
            output;
            xlink=&amp;amp;other_shift+&amp;amp;other_radius*cos(4*constant('pi')/3);
            ylink=&amp;amp;other_radius*sin(4*constant('pi')/3);
            output;
        run;
        data _plotb2(drop=text xtext ytext) _textb (keep=text xtext ytext);
            set _plotb;
            retain endpoint id;
            if _n_=1 then endpoint=0;
            id+1;
            text=strip(put(percent,12.0))||'%';
            xtext=&amp;amp;other_shift+0.5*&amp;amp;other_radius*cos(2*constant('pi')*(ppt/2+endpoint));
            ytext=0.5*&amp;amp;other_radius*sin(2*constant('pi')*(ppt/2+endpoint));output _textb;
            series=1;x=&amp;amp;other_shift;y=0;output _plotb2;  
            series=0;
            do i = (2*constant('pi'))*(endpoint) to (2*constant('pi'))*(ppt+endpoint) by (2*constant('pi'))*(ppt/50);
                x=&amp;amp;other_shift+&amp;amp;other_radius*cos(i);
                y=&amp;amp;other_radius*sin(i);
                output _plotb2;
            end;
            series=1;output _plotb2;
            endpoint=endpoint+ppt;
        run;
    %end;
        
    data _text;
        set _texta %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do; _textb %end;;
    run;
    data _plot;
        set _plota2 (in=a) %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do; _plotb2 (in=b) %end;;
        retain lastid;
        if a then lastid=id;
        else do;
            circle=2;
            id=id+lastid;
        end;
    run;
    
    data _plot;
        merge _plot _text %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do; _links %end;;
    run;
    ods path WORK.TEMPLAT(UPDATE) SASHELP.TMPLMST (READ);
    proc template;
        define statgraph _pie;
        begingraph / 
            
            %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do;
                designheight=5in designwidth=10in
            %end;
            %else %do;
                designheight=5in designwidth=7in
            %end;;
        layout lattice;
            sidebar / align=right;            
                discretelegend 'p1'  / exclude=(' ') location=inside halign=right valign=center border=false across=1 valueattrs=(size=18pt)
                    displayclipped=true autoitemsize=true;
            endsidebar;
            layout overlay / walldisplay=none xaxisopts=(display=none 
                %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do;
                    linearopts=(viewmin=-1.1 viewmax=%sysevalf(&amp;amp;other_shift+&amp;amp;other_radius+0.1))) 
                %end;
                %else %do;
                    linearopts=(viewmin=-1.1 viewmax=1.1)) 
                %end;
                    
                yaxisopts=(display=none linearopts=(viewmin=-1.1 viewmax=1.1));
                /*Left Pie Chart*/
                polygonplot x=eval(ifn(circle^=2,x,.)) y=y id=id / outlineattrs=(color=black pattern=1) display=(fill) group=_var_ name='p1'
                    dataskin=gloss;
                seriesplot x=eval(ifn(series=1 and circle^=2,x,.)) y=y / lineattrs=(color=black pattern=1) group=id;
                DRAWOVAL X=0 Y=0 WIDTH=2 HEIGHT=2 / display=(outline) outlineattrs=(color=black) heightunit=data 
                    drawspace=datavalue widthunit=data;
                    
                /*Right Pie Chart*/
                %if %sysevalf(&amp;amp;_othgrps&amp;gt;0,boolean) %then %do;
                    polygonplot x=eval(ifn(circle=2,x,.)) y=y id=id / outlineattrs=(color=black pattern=1) display=(fill) group=_var_ dataskin=gloss;
                    seriesplot x=xlink y=ylink / group=link lineattrs=(color=black pattern=1);
                    DRAWOVAL X=&amp;amp;other_shift Y=0 WIDTH=%sysevalf(2*&amp;amp;other_radius) HEIGHT=%sysevalf(2*&amp;amp;other_radius) / display=(outline) outlineattrs=(color=black) heightunit=data 
                        drawspace=datavalue widthunit=data;
                        
                    seriesplot x=eval(ifn(series=1 and circle=2,x,.)) y=y / lineattrs=(color=black pattern=1) group=id;
                %end;
                /*Percentages*/
                textplot x=xtext y=ytext text=text / textattrs=(size=16pt) position=center;
            endlayout;
        endlayout;
        endgraph;
        end;
    run;
    ods graphics / reset scale=off imagename="&amp;amp;plotname" imagefmt=&amp;amp;plottype; 
    proc sgrender data=_plot template=_pie;
    run;
    
    proc datasets nodetails nolist;
       delete _temp _temp2 _plota _plota2 _plotb _plotb2 _links _text _texta _textb  _Frq _frq2;
    quit;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Nov 2021 17:15:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780277#M22314</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2021-11-15T17:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to explode slice Sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780309#M22315</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;On top of my previous reply (see above message).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use GCHART Procedure with&lt;/P&gt;
&lt;P&gt;PIE, PIE3D, and DONUT Statement&lt;/P&gt;
&lt;P&gt;, you have access to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EXPLODE= option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any reason why you would prefer PROC SGPIE over PROC GCHART ??&lt;/P&gt;
&lt;P&gt;If not, use the latter to accomplish what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Proc Gchart would require a SAS/Graph license and OP may not have such while the SG graphics procs are part of the basic install.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I fought with Proc Gchart for a number of years. Didn't really miss it when SGPLOT became available (don't do Pie charts unless threatened with serious bodily harm &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;).&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 21:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780309#M22315</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-11-15T21:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to explode slice Sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780414#M22320</link>
      <description>&lt;P&gt;If by 'explode' you mean to separate one slice out from the rest of the pie, I would recommend using SAS/Graph Proc Gchart (which has the explode= option), as Koen suggests. Proc SGpie is still pre-production.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example showing how to use the explode option in Proc Gchart:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://robslink.com/SAS/democd7/pie6_info.htm" target="_blank"&gt;http://robslink.com/SAS/democd7/pie6_info.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 13:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780414#M22320</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-11-16T13:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to explode slice Sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780415#M22321</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&amp;nbsp;Thanks for the sample solutions. I have no specific reason for wanting to use sgpie over gchart. I use mostly sgplots because I find them easier. I already have defined attrmaps which I can easily use over and over. I created a donut chart yesterday and I thought it will be interesting to explode a slice but if this is not possible then is okay. I find the explode procedure also interesting. I will have a look at that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/2153"&gt;@JeffMeyers&lt;/a&gt;&amp;nbsp;thanks for that, it's an interesting example. I will have a look at that for other analysis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 13:22:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/780415#M22321</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-11-16T13:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to explode slice Sgpie</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/781013#M22336</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/2153"&gt;@JeffMeyers&lt;/a&gt;&amp;nbsp; I was going through your code and have some few questions:&lt;/P&gt;
&lt;P&gt;what are the values of the following&lt;/P&gt;
&lt;P&gt;&amp;amp;radius&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;other_shift&lt;/P&gt;
&lt;P&gt;&amp;amp;other_radius&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;&amp;amp;_othgrps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 13:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-explode-slice-Sgpie/m-p/781013#M22336</guid>
      <dc:creator>Anita_n</dc:creator>
      <dc:date>2021-11-18T13:25:55Z</dc:date>
    </item>
  </channel>
</rss>

