<?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: PROC GCHART bars not showing up in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242302#M8797</link>
    <description>&lt;P&gt;The format thing did change 1.0, 2.0, etc to 1, 2, etc.&amp;nbsp; I've never put a format in a PROC GCHART before and I never had this problem so I'm guessing that the root problem is that the numbers are not exactly 1, 2, etc as I thought they were.&amp;nbsp; If they were exactly 1, 2, etc then I assume I wouldn't SAS woudln't think about decimal places.&amp;nbsp; So I guess my problem is the numbers aren't exact integers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I realize the internal storage of the computer is a whole other mystery world so even though the numbers appear as 1, 2, etc on my screen maybe they're not stored internally that way&amp;nbsp; I assign X = 0 and then if an event occurs I do X = X + 1 so it seems like X should always be an integer but I guess not.&amp;nbsp; When I created all this it was in a big macro that ran many times in a big loop so maybe a shortage of memory or something forced SAS to use shortcuts in memory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did just now create a rounded variable like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Z = round (Y)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where Y was the original variable and then I ran PROC GCHART on Z and I still got no bars at 1 and 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code in case that helps.&amp;nbsp; I'm about to leave for home but I am going to e-mail this to myself and then work on it at home later tonight.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%MACRO PLOT (el, min); &lt;BR /&gt;proc sort data=plot_&amp;amp;EL; by z ; run; &lt;BR /&gt;proc means data=plot_&amp;amp;EL n mean stderr; by z ; var eCO; run; &lt;BR /&gt;axis1 label = ('Number of Cigs ' "&amp;amp;EL" ' in Previous ' "&amp;amp;MIN" ' Minutes') &lt;BR /&gt; order = 0 to 5 by 1; &lt;BR /&gt;axis2 label = ('eCO') &lt;BR /&gt; order = 0 to 40 by 10; &lt;BR /&gt;proc gchart data=plot_&amp;amp;EL; &lt;BR /&gt; vbar z / &lt;BR /&gt; type = mean &lt;BR /&gt; sumvar = eCO &lt;BR /&gt; errorbar = both &lt;BR /&gt; maxis = axis1 &lt;BR /&gt; raxis = axis2 &lt;BR /&gt;; &lt;BR /&gt;run; &lt;BR /&gt;%MEND PLOT; &lt;/P&gt;</description>
    <pubDate>Fri, 08 Jan 2016 00:23:08 GMT</pubDate>
    <dc:creator>n6</dc:creator>
    <dc:date>2016-01-08T00:23:08Z</dc:date>
    <item>
      <title>PROC GCHART bars not showing up</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242296#M8794</link>
      <description>&lt;P&gt;I have cigarette smoking data along with a continuous variable of interest.&amp;nbsp; I compute how many cigs were smoked in the last 15, 30 and 60 minutes before the measure was taken.&amp;nbsp; It turns out the the number of cigs smoked in the last 15 minutes is 0, 1 or 2, in the last 30 minuts is 0, 1, 2 or 3 and in the last 60 minutes is 0, 1, 2, 3, 4 or 5.&amp;nbsp; Okay, that's all fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then what I want to do is make a vertical bar chart.&amp;nbsp; On the y-axis is the mean measure of interest and on the x-axis is separate bars for the number of cigs smoked.&amp;nbsp; I'm using PROC GCHART.&amp;nbsp; When I do it for 15 minutes it works fine and vertical bars at 0, 1 and 2 show up.&amp;nbsp; When I do it for 60 minutes it works fine and vertical bars for 0, 1, 2, 3, 4 and 5 show up.&amp;nbsp; Okay, still fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I do it for 30 minutes, instead of getting vertical bars at 0, 1, 2 and 3 as I should, I get vertical bars at only 0 and 3.&amp;nbsp; (As an aside, although it works for 15 and 60 minutes, the x-axis ticks don't say 0, 1, 2, etc and instead say 0.0, 1.0, 2.0, etc.&amp;nbsp; Maybe that's a clue in all this.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In an AXIS statement my code has the line&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;order = 0 to 5 by 1; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the bars for 1 and 2 don't show up.&amp;nbsp; (Or if I change 5 to 3 then the same thing happens.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I tried order = 0 to 5 by 0.1 and still the bars for 1 and 2 didn't show up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I tried 0 to 5 by 0.01 and the bars for 1 and 2 DID show up.&amp;nbsp; It's all squished together because I have so many points on the x-axis so I can't tell exactly where they're at, be it 1.99 or 2.01 or whatever, but the bars at (or close to) 1 and 2 are there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why is this?&amp;nbsp; I want to use 0 to 5 by 1 (or maybe 0 to 3 by 1) and have bars at 0, 1, 2 and 3, but I can't seem to accomplish this, I guess because SAS somehow thinks the value aren't exactly 1 and 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did a PROC FREQ with a format 30.28, to see 28 numbers to the right of the decimal for 0, 1, 2 and 3 and every single number to the right of the decimal is 0, e.g., it's 2.0000000000000000000000000000 rather than something else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas?&amp;nbsp; When I created these numbers I set a counter to 0 and then if a person smoked I cig I incremented the counter by 1 so I don't see how the values can be anything other than exactly 0, 1, 2 or 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any info is appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Signed,&lt;/P&gt;
&lt;P&gt;Mystified in Chapel Hill&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 23:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242296#M8794</guid>
      <dc:creator>n6</dc:creator>
      <dc:date>2016-01-07T23:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: PROC GCHART bars not showing up</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242298#M8795</link>
      <description>We'd need to see the code, possible output and/or some sample data.</description>
      <pubDate>Thu, 07 Jan 2016 23:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242298#M8795</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-07T23:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC GCHART bars not showing up</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242300#M8796</link>
      <description>&lt;P&gt;The values displayed on the X axis are related to the Format of the variable. Add Format Xvariablename f1.0; to the Gchart code and you should see 0, 1, 2 instead of the decimal versions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your X variable&amp;nbsp;is calculated it &amp;nbsp;you may need to ROUND the value to an integer&amp;nbsp;before graphing it.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 23:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242300#M8796</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-07T23:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: PROC GCHART bars not showing up</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242302#M8797</link>
      <description>&lt;P&gt;The format thing did change 1.0, 2.0, etc to 1, 2, etc.&amp;nbsp; I've never put a format in a PROC GCHART before and I never had this problem so I'm guessing that the root problem is that the numbers are not exactly 1, 2, etc as I thought they were.&amp;nbsp; If they were exactly 1, 2, etc then I assume I wouldn't SAS woudln't think about decimal places.&amp;nbsp; So I guess my problem is the numbers aren't exact integers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I realize the internal storage of the computer is a whole other mystery world so even though the numbers appear as 1, 2, etc on my screen maybe they're not stored internally that way&amp;nbsp; I assign X = 0 and then if an event occurs I do X = X + 1 so it seems like X should always be an integer but I guess not.&amp;nbsp; When I created all this it was in a big macro that ran many times in a big loop so maybe a shortage of memory or something forced SAS to use shortcuts in memory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did just now create a rounded variable like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Z = round (Y)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where Y was the original variable and then I ran PROC GCHART on Z and I still got no bars at 1 and 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code in case that helps.&amp;nbsp; I'm about to leave for home but I am going to e-mail this to myself and then work on it at home later tonight.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%MACRO PLOT (el, min); &lt;BR /&gt;proc sort data=plot_&amp;amp;EL; by z ; run; &lt;BR /&gt;proc means data=plot_&amp;amp;EL n mean stderr; by z ; var eCO; run; &lt;BR /&gt;axis1 label = ('Number of Cigs ' "&amp;amp;EL" ' in Previous ' "&amp;amp;MIN" ' Minutes') &lt;BR /&gt; order = 0 to 5 by 1; &lt;BR /&gt;axis2 label = ('eCO') &lt;BR /&gt; order = 0 to 40 by 10; &lt;BR /&gt;proc gchart data=plot_&amp;amp;EL; &lt;BR /&gt; vbar z / &lt;BR /&gt; type = mean &lt;BR /&gt; sumvar = eCO &lt;BR /&gt; errorbar = both &lt;BR /&gt; maxis = axis1 &lt;BR /&gt; raxis = axis2 &lt;BR /&gt;; &lt;BR /&gt;run; &lt;BR /&gt;%MEND PLOT; &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 00:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242302#M8797</guid>
      <dc:creator>n6</dc:creator>
      <dc:date>2016-01-08T00:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC GCHART bars not showing up</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242393#M8802</link>
      <description>&lt;P&gt;Can you provide an example data set with the variables involved in the plot that shows this issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Minor style point: You are making this line more complicated than needed:&lt;/P&gt;
&lt;P&gt;axis1 label = ('Number of Cigs ' "&amp;amp;EL" ' in Previous ' "&amp;amp;MIN" ' Minutes')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try&lt;/P&gt;
&lt;P&gt;axis1 label = ("Number of Cigs&amp;nbsp;&amp;amp;EL in Previous&amp;nbsp;&amp;amp;MIN Minutes")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Breaking up the pieces of a label is really only needed if you are applying different text characteristics for different bits of the title.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2016 16:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-GCHART-bars-not-showing-up/m-p/242393#M8802</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-08T16:07:12Z</dc:date>
    </item>
  </channel>
</rss>

