Loading ...
Sorry, an error occurred while loading the content.

362Re: xrange for a relative date window?

Expand Messages
  • romeyde
    Mar 19, 2003
    • 0 Attachment
      I'm trying to use this example but it's just not working for me. I
      have a dat file that contains about 3 weeks worth of webhits data.
      The file looks like this:

      02/20/03.20:00 14694
      02/20/03.20:05 52909
      02/20/03.20:10 51928
      02/20/03.20:15 48707
      02/20/03.20:20 46417

      There is a tab between the fields.

      My pol config file looks like this:

      -----------------------------------------------
      #call $setdatefmt( "mm/dd/yy" )
      #set xmax = $todaysdate()
      #set xmin = $dateadd( @xmax, -7 )

      #proc getdata
      file: $FILENAME
      fieldnames: datetime hits
      delim: tab

      #proc areadef
      title: @title
      titledetails: align=L size=16 style=B color=darkblue
      rectangle: 1 1 7.8 2.5
      xscaletype: date
      xrange: @xmin @xmax
      yautorange datafield=hits nearest=100 margin=200 lowfix=0
      xaxis.stubs: inc
      xaxis.stubformat: MMMdd
      yaxis.stubs: inc
      yaxis.labeldistance: .8
      frame: yes

      #proc processdata
      action: count
      fields: datetime hits
      showresults: no

      #proc bars
      locfield: datetime
      lenfield: hits
      truncate: yes
      thinbarline: color=green
      -----------------------------------------------

      I want it to only graph the last 7 days of data but I keep ending up
      just getting everything.

      I am calling pl like this:

      ~/plbin210/bin/pl ~/reports/webhits.pol -o \
      /web/html/dwr/webhitsTEST.gif -gif delim tab \
      title="$SITE Web Gets and Posts `date +%y%m%d`" -maxrows 100000

      BTW, should I still have to use the maxrows flag when I only want to
      graph 7 days worth of data? Sure the dat file is huge but I only want
      pl to process a small part of it.

      Thanks for any assistance,
      Derek



      > > Robin,
      > >
      > > This should do it:
      > >
      > > #call $setdatefmt( mm/dd/yyyy ) [or whatever..]
      > > #set xmax = $todaysdate()
      > > #set xmin = $dateadd( @xmax, -7 )
      > >
      > > #proc areadef
      > > xscaletype: date
      > > xrange: @xmin @xmax
      > > rectangle: 1 1 7 3
      > > yrange: 0 10
      > > xaxis.stubs: inc
      > > xaxis.stubformat: MMMdd [or whatever..]
      > >
      > >
      > > -Steve
      > >
      > > On Wed, 5 Feb 2003, Robin Duggar <rduggar@p...> wrote:
      > >
      > > > Is it possible to define xrange in proc areadef for either last 7
      > > > days or even just 7 days, instead of using specific dates (rather
      > not
      > > > use even day of week names)? I'm trying to write the script so
      > it
      > > > can be reused on a daily basis without reformulating it.
      > > >
      > > > Thanks!
      > > > - Robin
      > > >
      > > >
      > > >
      > > > To unsubscribe from this group, send an email to:
      > > > ploticus-unsubscribe@yahoogroups.com
      > > >
      > > >
      > > >
      > > > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      > > >
      > > >
      > > >
      > >
      > >
      > > Stephen C. Grubb scg@j...
      > > Scientific Software Engineer, The Jackson Laboratory
      > > 600 Main Street Bar Harbor, Maine 04609 USA
    • Show all 9 messages in this topic