<?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 add a counter to Animated Barchart using SGPlot Prcedure in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568889#M18370</link>
    <description>&lt;P&gt;The issue I have with that is that I want the graph to build over time until the entire graph is filled. Using the by variable to create the gif only shows the bar at that specific time.&amp;nbsp; &amp;nbsp;The macro I have creates the graph from the starting time to the current time.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2019 18:32:24 GMT</pubDate>
    <dc:creator>ktitler</dc:creator>
    <dc:date>2019-06-25T18:32:24Z</dc:date>
    <item>
      <title>How to add a counter to Animated Barchart using SGPlot Prcedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568779#M18366</link>
      <description>&lt;P&gt;I created an animated barchart using proc sgplot.&amp;nbsp; The barchart animates over a period of minutes.&amp;nbsp; I am trying to add in a text box or footnote that shows the current time as the animation progresses.&amp;nbsp; I was able to animate the time, but the animation of the graph disappeared.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code I use to animate the barchart.&amp;nbsp; I have also attached a sample of the dataset that I use.&amp;nbsp; The dataset am is only the am portion of the attached dataset.&amp;nbsp; The dataset myattrmap is imported from another file which details the colors of the bars by group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro lineAnnuallyAM(dsn=, start=, end=);&lt;BR /&gt;%let start = "6:00 AM"t;&lt;BR /&gt;%let end = "9:30 AM"t;&lt;/P&gt;&lt;P&gt;%let dif = %sysfunc(intck(minute,&amp;amp;start,&amp;amp;end));&lt;BR /&gt;%do i=0 %to &amp;amp;dif;&lt;BR /&gt;%let time=%sysfunc(intnx(minute,&amp;amp;start,&amp;amp;i,b),timeampm9.);&lt;/P&gt;&lt;P&gt;proc sgplot data=am dattrmap = myattrmap;&lt;BR /&gt;*used to control the time period shown on the graph;&lt;BR /&gt;where &amp;amp;start &amp;lt; time &amp;lt; "&amp;amp;time"t;&lt;/P&gt;&lt;P&gt;title j=center font = 'Times New Roman' color = white bcolor = '#085156' 'Bethlehem Central School District Deployment Model AM - Vehicles in Operation Carrying Students';&lt;BR /&gt;vbar time /response = buses stat = sum group = School_Group datalabel attrid=myid;&lt;BR /&gt;xaxis display =(nolabel) valuesrotate=vertical values = ("6:00"t to "09:30"t by "0:05"t);&lt;BR /&gt;yaxis grid values = (0 to 85 by 5);&lt;/P&gt;&lt;P&gt;refline "7:35 AM" /&lt;BR /&gt;axis = x lineattrs=(pattern=2 thickness = 3 color = "#FF0000") label = "7:35 AM";&lt;/P&gt;&lt;P&gt;refline "8:00 AM" /&lt;BR /&gt;axis = x lineattrs=(pattern=2 thickness = 3 color = "#0000FF") label = "8:00 AM";&lt;/P&gt;&lt;P&gt;refline "9:20 AM" /&lt;BR /&gt;axis = x lineattrs=(pattern=2 thickness = 3 color = "#00FF00") label = "9:20 AM";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend lineAnnuallyAM;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*--Create animation--*/&lt;BR /&gt;options papersize=('11 in', '7 in')&lt;BR /&gt;printerpath=gif&lt;BR /&gt;animation=start&lt;BR /&gt;animduration=0.25&lt;BR /&gt;animloop=no&lt;BR /&gt;noanimoverlay&lt;BR /&gt;nonumber;&lt;BR /&gt;ods printer file='C:\Users\Kristi Titler\OneDrive - Student Transportation Inc\Desktop\AM Deployment.gif';&lt;/P&gt;&lt;P&gt;ods graphics / width=10in height=6in imagefmt=GIF;&lt;/P&gt;&lt;P&gt;%lineAnnuallyAM(dsn=am , start="6:00 AM"t, end="09:30 AM"t);&lt;/P&gt;&lt;P&gt;options printerpath=gif animation=stop;&lt;BR /&gt;ods printer close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 14:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568779#M18366</guid>
      <dc:creator>ktitler</dc:creator>
      <dc:date>2019-06-25T14:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a counter to Animated Barchart using SGPlot Prcedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568872#M18368</link>
      <description>&lt;P&gt;If you &lt;A href="https://blogs.sas.com/content/iml/2016/08/22/animation-by-statement-proc-sgplot.html" target="_self"&gt;use the BY statement in PROC SGPLOT to create the animation&lt;/A&gt;, then the BY-group variable will appear automatically.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 17:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568872#M18368</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-06-25T17:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a counter to Animated Barchart using SGPlot Prcedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568889#M18370</link>
      <description>&lt;P&gt;The issue I have with that is that I want the graph to build over time until the entire graph is filled. Using the by variable to create the gif only shows the bar at that specific time.&amp;nbsp; &amp;nbsp;The macro I have creates the graph from the starting time to the current time.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 18:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568889#M18370</guid>
      <dc:creator>ktitler</dc:creator>
      <dc:date>2019-06-25T18:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a counter to Animated Barchart using SGPlot Prcedure</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568903#M18371</link>
      <description>&lt;P&gt;Would adding the following line after your TITLE statement work for you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;title2 "Time = &amp;amp;time";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;BR /&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 18:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-add-a-counter-to-Animated-Barchart-using-SGPlot-Prcedure/m-p/568903#M18371</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-06-25T18:54:52Z</dc:date>
    </item>
  </channel>
</rss>

