<?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: IML Gbarline procedure: how to make use of formatted values for tickmark labels in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700401#M20750</link>
    <description>It seems, i have been using the same structure, I have prepared format like&lt;BR /&gt;********************************start code:;&lt;BR /&gt;proc summary nway noprint data=dsin;&lt;BR /&gt;var date1;&lt;BR /&gt;output out=sum1 min=a_min max=a_max;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data _null_; set _last_; length sa $ 80;&lt;BR /&gt;file '_date_fmt.txt' lrecl=80;&lt;BR /&gt;put 'proc format; value date_fmt';&lt;BR /&gt;do a=a_min to a_max by 10;&lt;BR /&gt;if ((a_max-a)&amp;gt;=10) then do;&lt;BR /&gt;sa=put( a, 6.)!! '="'!! compress(put(a,ddmmyy10.))!!'"';&lt;BR /&gt;put sa $char80.;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;put 'other=" ";';&lt;BR /&gt;run;&lt;BR /&gt;%inc "_date_fmt.txt";run;&lt;BR /&gt;********************************end code:;&lt;BR /&gt;&lt;BR /&gt;However this was not working properly. Still, I will check if your code is&lt;BR /&gt;working&lt;BR /&gt;</description>
    <pubDate>Fri, 20 Nov 2020 05:58:39 GMT</pubDate>
    <dc:creator>FelixSta20</dc:creator>
    <dc:date>2020-11-20T05:58:39Z</dc:date>
    <item>
      <title>Gbarline  procedure: how to make use of formatted values for tickmark labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700240#M20747</link>
      <description>&lt;P&gt;I am using proc gbarline&amp;nbsp; within IML. the following example code&amp;nbsp; produces the graph&lt;/P&gt;
&lt;P&gt;proc gbarline data=dsin;&lt;BR /&gt;format date1;&lt;/P&gt;
&lt;P&gt;symbol1 c=red value=dot;&lt;BR /&gt;axis1 label=("New Cases");&lt;BR /&gt;axis2 label=("Total Count");&lt;BR /&gt;axis3 value=(a=-45);&lt;BR /&gt;bar date1 / discrete sumvar=newca raxis=axis1 maxis=axis3 levels=all;&lt;BR /&gt;plot / sumvar=totca axis=axis2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;The graph looks like&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gbarli10.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51834iA14AB40C518DF3F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gbarli10.png" alt="gbarli10.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; The horizontal axe labels are too overlapped.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My idea is to label only some tickmarks, one way is to use SAS generated format, ususally I was using this approach in SAS graph procedures.. However in this case when I use the code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gbarline data=dsin;&lt;BR /&gt;format date1 date_fmt.;&lt;/P&gt;
&lt;P&gt;symbol1 c=red value=dot;&lt;BR /&gt;axis1 label=("New Cases");&lt;BR /&gt;axis2 label=("Total Count");&lt;BR /&gt;axis3 value=(a=-45);&lt;BR /&gt;bar date1 / discrete sumvar=newca raxis=axis1 maxis=axis3 levels=all;&lt;BR /&gt;plot / sumvar=totca axis=axis2;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;The result is not what I would expect:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gbarli11.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51835i900F3DC137F2B8CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gbarli11.png" alt="gbarli11.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; I would appreciate any hints or statement, that this is not possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Nov 2020 21:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700240#M20747</guid>
      <dc:creator>FelixSta20</dc:creator>
      <dc:date>2020-11-19T21:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: IML Gbarline  procedure: how to make use of formatted   values for tickmark labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700354#M20748</link>
      <description>&lt;P&gt;Moved to &lt;EM&gt;Graphics&lt;/EM&gt; community.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;Any idea?&lt;/P&gt;
&lt;P&gt;Here is how to replicate the behaviour:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _F;                                  
  retain FMTTYPE 'N' FMTNAME 'mthstart' START '01jan1900'd ;
  do until( START='01oct2100'd );
    START=intnx('month',START,1);
    END  =START;
    LABEL=put(START,monyy7.);
    output;
  end;
  HLO='O'; LABEL=' '; output;
run;
proc format cntlin=_F; run;
  
proc gbarline data=SASHELP.CITIDAY;
  format DATE mthstart.;
  vbar DATE / sumvar=SNYDJCM discrete levels=all;
  plot      / sumvar=SNYSECM ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, how to remove&amp;nbsp;&lt;EM&gt;WARNING: The intervals on the axis ... are not evenly spaced.&lt;/EM&gt;&amp;nbsp; ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 06:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700354#M20748</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-21T06:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: IML Gbarline procedure: how to make use of formatted values for tickmark labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700401#M20750</link>
      <description>It seems, i have been using the same structure, I have prepared format like&lt;BR /&gt;********************************start code:;&lt;BR /&gt;proc summary nway noprint data=dsin;&lt;BR /&gt;var date1;&lt;BR /&gt;output out=sum1 min=a_min max=a_max;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data _null_; set _last_; length sa $ 80;&lt;BR /&gt;file '_date_fmt.txt' lrecl=80;&lt;BR /&gt;put 'proc format; value date_fmt';&lt;BR /&gt;do a=a_min to a_max by 10;&lt;BR /&gt;if ((a_max-a)&amp;gt;=10) then do;&lt;BR /&gt;sa=put( a, 6.)!! '="'!! compress(put(a,ddmmyy10.))!!'"';&lt;BR /&gt;put sa $char80.;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;put 'other=" ";';&lt;BR /&gt;run;&lt;BR /&gt;%inc "_date_fmt.txt";run;&lt;BR /&gt;********************************end code:;&lt;BR /&gt;&lt;BR /&gt;However this was not working properly. Still, I will check if your code is&lt;BR /&gt;working&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Nov 2020 05:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700401#M20750</guid>
      <dc:creator>FelixSta20</dc:creator>
      <dc:date>2020-11-20T05:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: IML Gbarline  procedure: how to make use of formatted   values for tickmark labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700878#M20751</link>
      <description>&lt;P&gt;I have not found&lt;/P&gt;&lt;P&gt;SASHELP.CITIDAY&lt;/P&gt;&lt;P&gt;in my version of SAS9.4&lt;/P&gt;&lt;P&gt;However, I made some checking and have realized, that this is not working in my case.&lt;/P&gt;&lt;P&gt;The&amp;nbsp; specificity of the data set used in my case lies in the fact, that values are available for a continuous set of dates, while&amp;nbsp; only some of them should have tickmarks. Specially generated format provides empty (blank) labels for most of the dates, however when applied, such a format doesn't work in&amp;nbsp; proc gbarline. While working in SAS graph procedures. Later I will submit some example.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 11:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/700878#M20751</guid>
      <dc:creator>FelixSta20</dc:creator>
      <dc:date>2020-11-23T11:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: IML Gbarline  procedure: how to make use of formatted   values for tickmark labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/701059#M20753</link>
      <description>&lt;P&gt;Your question is clear and the behaviour has been reproduced.&lt;/P&gt;
&lt;P&gt;I understand why this happens but cant think of a way around it, except using SAS/Graph. Maybe&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13837"&gt;@DonH_sas&lt;/a&gt;&amp;nbsp;would have an idea?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 21:06:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/701059#M20753</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-23T21:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Gbarline  procedure: how to make use of formatted values for tickmark labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/701211#M20754</link>
      <description>&lt;P&gt;The basic/fundamental problem is that bar charts generally treat each bar as a discrete evenly-spaced thing, and therefore want to label each bar. You're wanting the bar axis to be continuous, so that you can only label certain points along the axis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to do that, I suggest using a 'needle' plot (rather than a bar chart), and then overlay the average line. You can do that with either SAS/Graph gplot, or with ODS Graphics sgplot. I will demonstrate below one way to do it with sgplot:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;data my_data; set sashelp.stocks (where=(stock='IBM'));&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;proc expand data=my_data out=my_data;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;convert close=close12 / method=none transformout=(cmovave 12 trim 6);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;proc sgplot data=my_data noautolegend;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;needle y=close x=date;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;series y=close12 x=date / lineattrs=(color=red);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&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="needle.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51964i25600980FED120B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="needle.png" alt="needle.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 13:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/701211#M20754</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-11-24T13:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Gbarline  procedure: how to make use of formatted values for tickmark labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/701221#M20755</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;yes, I have arrived to these options too. As well as I have found one my graph with bars produced using annotate. This provides more control, though requires some more complicated&amp;nbsp; code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 14:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/701221#M20755</guid>
      <dc:creator>FelixSta20</dc:creator>
      <dc:date>2020-11-24T14:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Gbarline  procedure: how to make use of formatted values for tickmark labels</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/701524#M20758</link>
      <description>&lt;P&gt;After all, I have arrived to acceptable&amp;nbsp; solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data dsin; set &amp;amp;covidin Nobs=nobs;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc summary nway noprint data=dsin;&lt;BR /&gt;var date1;&lt;BR /&gt;output out=sum1 min=a_min max=a_max;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data _null_; set _last_;&amp;nbsp;&lt;BR /&gt;call symput('period', put(a_min,ddmmyy10.)!!' - '!!put(a_max,ddmmyy10.));&lt;BR /&gt;run;&lt;BR /&gt;title "Covid19. Russia, period &amp;amp;period.";&lt;BR /&gt;proc sgplot data=dsin;&lt;BR /&gt;format totca comma.;&lt;BR /&gt;needle y=newca x=date1;&lt;BR /&gt;series y=totca x=date1 /y2axis lineattrs=(color=red);&lt;BR /&gt;xaxis grid;&lt;BR /&gt;Yaxis grid;&lt;BR /&gt;Y2axis offsetmax=0.1;&lt;BR /&gt;Label newca="New cases"&lt;BR /&gt;date1="Calendar dates"&lt;BR /&gt;totca="Total cases";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="SGPlot45.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51992iF53CDB12449B5AB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SGPlot45.png" alt="SGPlot45.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 13:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Gbarline-procedure-how-to-make-use-of-formatted-values-for/m-p/701524#M20758</guid>
      <dc:creator>FelixSta20</dc:creator>
      <dc:date>2020-11-25T13:29:13Z</dc:date>
    </item>
  </channel>
</rss>

