<?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: gchart g100 percent and PDF in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/gchart-g100-percent-and-PDF/m-p/63432#M2156</link>
    <description>I suspect that the pdf is generating the bars a little narrower than your html plot, and there is not enough room for the labels.  Are you seeing a "Warning" in your log, such as ...&lt;BR /&gt;
&lt;BR /&gt;
   WARNING: The VBAR/VBAR3D chart for myfield1 could not be labeled because the labels are wider than the bars.&lt;BR /&gt;
&lt;BR /&gt;
I don't have your data, but I created some mock-up data, and I was able to reproduce the problem (and a fix).  The code below seems to work ok, once I added the "width=12" for the bars (depending on how many bars you have, etc, you might have to adjust the width to suit your data)...&lt;BR /&gt;
&lt;BR /&gt;
-----&lt;BR /&gt;
&lt;BR /&gt;
%let name=plt038;&lt;BR /&gt;
&lt;BR /&gt;
data mydata;&lt;BR /&gt;
input mygroupfield $ 1-6 myfield1 $ 8 myfield2;&lt;BR /&gt;
datalines;&lt;BR /&gt;
Group1 a 5&lt;BR /&gt;
Group1 b 7&lt;BR /&gt;
Group2 a 6&lt;BR /&gt;
Group2 b 7&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
GOPTIONS DEVICE=pdf;&lt;BR /&gt;
options nodate nonumber;&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING CLOSE;&lt;BR /&gt;
ODS pdf file="&amp;amp;name..pdf" startpage=no;&lt;BR /&gt;
&lt;BR /&gt;
proc gchart data=mydata;&lt;BR /&gt;
 vbar myfield1 / group=mygroupfield type=percent percent g100 freq=myfield2 width=12;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
ODS PDF CLOSE;&lt;BR /&gt;
ODS LISTING;

Message was edited by: Robert Allison @ SAS</description>
    <pubDate>Tue, 02 Mar 2010 14:49:50 GMT</pubDate>
    <dc:creator>GraphGuy</dc:creator>
    <dc:date>2010-03-02T14:49:50Z</dc:date>
    <item>
      <title>gchart g100 percent and PDF</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gchart-g100-percent-and-PDF/m-p/63431#M2155</link>
      <description>Dear all,&lt;BR /&gt;
&lt;BR /&gt;
I have a proc gchart with g100 where I display the percentage of each bar on top of it. This works fine in HTML but not in PDF. In PDF the percentage on top of the bars is simply missing.&lt;BR /&gt;
&lt;BR /&gt;
Here's my code:&lt;BR /&gt;
&lt;BR /&gt;
proc gchart data=work.mydata;&lt;BR /&gt;
 vbar myfield1 / group=mygroupfield type=percent percent g100 freq=myfield2;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Best regards&lt;BR /&gt;
Eva</description>
      <pubDate>Tue, 02 Mar 2010 13:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gchart-g100-percent-and-PDF/m-p/63431#M2155</guid>
      <dc:creator>Eva</dc:creator>
      <dc:date>2010-03-02T13:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: gchart g100 percent and PDF</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gchart-g100-percent-and-PDF/m-p/63432#M2156</link>
      <description>I suspect that the pdf is generating the bars a little narrower than your html plot, and there is not enough room for the labels.  Are you seeing a "Warning" in your log, such as ...&lt;BR /&gt;
&lt;BR /&gt;
   WARNING: The VBAR/VBAR3D chart for myfield1 could not be labeled because the labels are wider than the bars.&lt;BR /&gt;
&lt;BR /&gt;
I don't have your data, but I created some mock-up data, and I was able to reproduce the problem (and a fix).  The code below seems to work ok, once I added the "width=12" for the bars (depending on how many bars you have, etc, you might have to adjust the width to suit your data)...&lt;BR /&gt;
&lt;BR /&gt;
-----&lt;BR /&gt;
&lt;BR /&gt;
%let name=plt038;&lt;BR /&gt;
&lt;BR /&gt;
data mydata;&lt;BR /&gt;
input mygroupfield $ 1-6 myfield1 $ 8 myfield2;&lt;BR /&gt;
datalines;&lt;BR /&gt;
Group1 a 5&lt;BR /&gt;
Group1 b 7&lt;BR /&gt;
Group2 a 6&lt;BR /&gt;
Group2 b 7&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
GOPTIONS DEVICE=pdf;&lt;BR /&gt;
options nodate nonumber;&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING CLOSE;&lt;BR /&gt;
ODS pdf file="&amp;amp;name..pdf" startpage=no;&lt;BR /&gt;
&lt;BR /&gt;
proc gchart data=mydata;&lt;BR /&gt;
 vbar myfield1 / group=mygroupfield type=percent percent g100 freq=myfield2 width=12;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
ODS PDF CLOSE;&lt;BR /&gt;
ODS LISTING;

Message was edited by: Robert Allison @ SAS</description>
      <pubDate>Tue, 02 Mar 2010 14:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gchart-g100-percent-and-PDF/m-p/63432#M2156</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2010-03-02T14:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: gchart g100 percent and PDF</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/gchart-g100-percent-and-PDF/m-p/63433#M2157</link>
      <description>Dear Robert Allison,&lt;BR /&gt;
&lt;BR /&gt;
from tho look of it it could be that the bars are too narrow. I tried applying width but it didn't work until I used &lt;BR /&gt;
&lt;BR /&gt;
options papersize=a3;&lt;BR /&gt;
&lt;BR /&gt;
as well. There was simply not enough room for the graph.&lt;BR /&gt;
&lt;BR /&gt;
Seem like most pdf problems are solved with width and the like...&lt;BR /&gt;
&lt;BR /&gt;
Eva</description>
      <pubDate>Tue, 02 Mar 2010 15:22:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/gchart-g100-percent-and-PDF/m-p/63433#M2157</guid>
      <dc:creator>Eva</dc:creator>
      <dc:date>2010-03-02T15:22:06Z</dc:date>
    </item>
  </channel>
</rss>

