Login  Register

Re: form.line position with date-formatted axes

Posted by Andy W on Dec 17, 2022; 1:13pm
URL: http://spssx-discussion.165.s1.nabble.com/form-line-position-with-date-formatted-axes-tp5741098p5741103.html

IIRC, this has been the behavior for along time. A workaround is to create data and pass that into the graph function to draw the line. Approximate outline (appears I need to update SPSS license, so cannot test myself right away):

 - create a new date variable for 6/15/2020, have it only fill in one row

 - include this new variable in the GRAPHDATASET line, set MISSING=VARIABLEWISE

 - create a new edge element, something like:

     TRANS: bottom=eval(-1)
     TRANS: top = eval(1)
     ELEMENT: edge(position((DateVar*bottom)+(DateVar*top))

(Note, I am not sure if TRANS will play nice with missing data. If not, create a variable in the dataset bottom/top and pass that in same as the new DateVar.)

 - You may need to set the scale of the graph now, as it may extend to encompass your line. To get the behavior of form.line you want it to scale the entire plot area.

   SCALE: linear(dim(2), min(0), max(0.35))
Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/