# timeline2

How to download and try this example

    Usage: pl -gif timeline2.htm

    // specify data using proc getdata
    #proc getdata
    data:
    OWUNN 01/12/99   11/12/98 03/13/99
    SMFWW 01/19/99   11/19/98 03/18/99
    SDUNN 01/26/99   11/26/98 03/25/99
    BAABR 01/31/99   12/01/98 04/01/99
    UBANI 02/22/99   12/22/98 04/22/99

    // set up plotting area using proc areadef
    // Note that date format of mm/dd/yy is specified as the xscaletype.
    #proc areadef
       title: Allowable follow-up visit time windows
       rectangle: 1 1 5 2
       xscaletype: date mm/dd/yy
       xrange: 11/01/98 05/01/99
       yscaletype: categories
       ycategories: datafield 1

    // set up x and y axes using proc axis
    // first time- do month stubs every 3 months
    #proc xaxis
       stubs: incremental 1 month
       stubformat: MMMyy

    // run it again to do the grid at every month
    #proc xaxis
       stubs: none
       ticincrement: 1 month
       grid: color=blue

    #proc yaxis
       stubs: categories
       label: Patient code
       labeldetails: adjust=-0.2,0
       grid: color=green

    // render bars using proc bars
    // use segmentfields and tails but not lenfield
    #proc bars
       color: green
       barwidth: 0.05
       horizontalbars: yes
       segmentfields: 3 4
       locfield: 1
       tails: 0.1

    // render dots using proc scatterplot
    #proc scatterplot
       xfield: 2
       yfield: 1
       symbol: shape=circle style=filled fillcolor=red
       legendlabel: = Target\n  date

    // render legend using proc legend
    #proc legend
       format: singleline
       location: max-0.5 max