<?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: Two decimal places in stacked boxplot in gchart in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694769#M20606</link>
    <description>&lt;P&gt;I managed to get rid of the blank area after following what this&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;post has advised&amp;nbsp;&lt;/SPAN&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-creates-too-much-blank-space/td-p/193040" target="_blank"&gt;https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-creates-too-much-blank-space/td-p/193040&lt;/A&gt;&lt;BR /&gt;However, the legend entries are small.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2020 09:19:07 GMT</pubDate>
    <dc:creator>Miracle</dc:creator>
    <dc:date>2020-10-28T09:19:07Z</dc:date>
    <item>
      <title>Two decimal places in stacked boxplot in gchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694520#M20602</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;Can I please seek your help on how to display the percentages in two decimal places inside the bars?&lt;BR /&gt;Here I am sharing my code for your information.&lt;BR /&gt;Your help would be greatly appreciated.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;goptions reset=all gsfmode=replace gsfname=outpng device=png target=png xmax=9 in ymax=5.7 in xpixels=2250 ypixels=1500 htext=1.6pct;

axis1 label=none value=(h=1.5 tick=1 " " tick=2 " " tick=3 " " tick=4 " " 
tick=5 " " tick=6 " " tick=7 " " tick=8 " " 
tick=9 " " tick=10 " " )
minor=none;   

axis3 label=none value=(height=1.5
tick=1 "x1 (&amp;amp;c1.)"  tick=2 "x2 (&amp;amp;c2.)"  
			tick=3 "x3 (&amp;amp;c3.)"  tick=4 "x4 (&amp;amp;c4.)"   tick=5 "x5 (&amp;amp;c5.)"  
			tick=6 "x6 (&amp;amp;c6.)"  tick=7 "x7 (&amp;amp;c7.)"  tick=8 "x8 (&amp;amp;c8.)" 
           tick=9 "x9 (&amp;amp;c9.)"  tick=10 "x10 (&amp;amp;c10.)" ) 
minor=none;                                                                                                             
                                                                                                                                      
axis2 label=(h=2 a=90 ' ') 
      value = (height=2.0  tick=1 '0%' tick=2 '10%' tick=3 '20% ' tick=4 '30%'  tick=5 '40%' tick=6 '50%' tick=7 '60%' tick=8 '70%'
           tick=9 '80%' tick=10 '90%' tick=11 '100%')
      minor=none
      length=2.7 in
	  order=(0 to 100  by 10); 
	                                                                                                                                         
legend1 label= none 
        value = (height=1.5 j=left "legend 1" "legend 2" "legend 3" "legend 4" "legend 5") mode=protect
        position=(bottom outside);


proc gchart data=final;  
  label flag=" "; 
   vbar flag /   discrete subgroup=subgrp 
                 group=flag g100  nozero                                                                                               
                 freq=count type=percent                                                                                               
                 inside=percent width=10
                 raxis=axis2 maxis=axis3  gaxis=axis1                                                                                             
                 legend=legend1 width=7 gspace=1 ; 
run;                                                                                                                                    
quit; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 13:08:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694520#M20602</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2020-10-28T13:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Two decimal places in stacked boxplot in gchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694614#M20603</link>
      <description>&lt;P&gt;You might try INSIDE=SUBPCT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I never really liked letting GCHART calculate percentages as I was always having to fiddle something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And might be time to move to Proc SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No data, a slew of macro variables with no idea what they might be means we can't test any code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This example, very slightly modified from the Proc GChart documentation (hint) shows percentages to 2 decimals:&lt;/P&gt;
&lt;PRE&gt;data totals;
length dept $ 7 site $ 8;
input dept site quarter sales;
datalines;
Parts Sydney 1 7043.97
Parts Atlanta 1 8225.26
Tools Paris 4 1775.74
Tools Atlanta 4 3424.19
Repairs Sydney 2 5543.97
Repairs Paris 3 6914.25
;
title1 "Total Sales by Site";
axis1 label=none offset=(10,8);
axis2 label=none order=(0 to 20000 by 5000) minor=none offset=(,0);
legend1 label=none shape=bar(.15in,.15in) cborder=black;


proc gchart data=totals;
format sales dollar8.;
vbar site / sumvar=sales subgroup=dept inside=subpct
     outside=sum
     width=9
     space=7
     maxis=axis1
     raxis=axis2
     cframe=white
     autoref cref=gray
     legend=legend1;
run;
quit;title;&lt;/PRE&gt;
&lt;P&gt;Again, you have not actual option that controls the format of the displayed values, the procedure is doing that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 15:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694614#M20603</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-27T15:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Two decimal places in stacked boxplot in gchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694639#M20604</link>
      <description>&lt;P&gt;&lt;FONT face="andale mono,times" size="4"&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;. Thank you for your quick response.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" size="4"&gt;We have tried sgplot and are able to get the two decimal places in every segments of the bars.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times" size="4"&gt;However, we are having another problem now.&lt;BR /&gt;How do we fully utilize&amp;nbsp;the empty area(green highlighted) between the chart and legend?&lt;BR /&gt;The legend will not even show if we increase either height, thickness or&amp;nbsp;&lt;CODE class=" language-sas"&gt;valueattrs=(size=7pt).&lt;/CODE&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times" size="4"&gt;Thanks a lot.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on / width=60 in height=45 in noborder;
Proc sgplot data=temp noautolegend pad=(top=1%);
vbar flag / group=subgrp response=percent seglabel seglabelformat=f6.2 grouporder=data;

legenditem  type=line name="0" / lineattrs=(pattern=solid thickness=3) lineattrs=GraphData1 label="Legend 1";
legenditem  type=line name="1" / lineattrs=(pattern=solid thickness=3) lineattrs=GraphData2 label="Legend 2";
legenditem  type=line name="2" / lineattrs=(pattern=solid thickness=3) lineattrs=GraphData3 label="Legend 3";
legenditem  type=line name="3" / lineattrs=(pattern=solid thickness=3) lineattrs=GraphData4 label="Legend 4";
.......... up to  
legenditem  type=line name="8" / lineattrs=(pattern=solid thickness=3) lineattrs=GraphData8 label="Legend 8";

keylegend  "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" / location=outside position=bottomleft
title=" " across=3 down=3 valueattrs=(size=7pt) fillaspect=golden linelength=20 noborder;

xaxis label=" " values=(1,2,3,4,5,6,7,8,9,10) valueattrs=(size=7pt) 
valuesdisplay=(
"1st (&amp;amp;c1.)"   
"2nd (&amp;amp;c2.)"  
"3rd (&amp;amp;c3.)"
"4th (&amp;amp;c4.)"  
"5th (&amp;amp;c5.)"  
"6th (&amp;amp;c6.)"  
"7th (&amp;amp;c7.)"  
"8th (&amp;amp;c8.)" 
"9th (&amp;amp;c9.)"  
"10th (&amp;amp;c10.)");
 
yaxis label=" " 
values = (0 to 100 by 10) valuesdisplay=("0%" "10%" "20%" "30%" "40%" "50%" "60%" "70%" "80%" "90%" "100%");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 11:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694639#M20604</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2020-10-28T11:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: Two decimal places in stacked boxplot in gchart</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694769#M20606</link>
      <description>&lt;P&gt;I managed to get rid of the blank area after following what this&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;post has advised&amp;nbsp;&lt;/SPAN&gt;&lt;A style="font-family: inherit; background-color: #ffffff;" href="https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-creates-too-much-blank-space/td-p/193040" target="_blank"&gt;https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-creates-too-much-blank-space/td-p/193040&lt;/A&gt;&lt;BR /&gt;However, the legend entries are small.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 09:19:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Two-decimal-places-in-stacked-boxplot-in-gchart/m-p/694769#M20606</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2020-10-28T09:19:07Z</dc:date>
    </item>
  </channel>
</rss>

