Login  Register

Re: form.line position with date-formatted axes

Posted by PRogman on Dec 20, 2022; 1:19pm
URL: http://spssx-discussion.165.s1.nabble.com/form-line-position-with-date-formatted-axes-tp5741098p5741104.html

A working solution is to specify the reference line with a full ISO 8601 string, ie "YYYY-MM-DDTHH-MM-SS.sss": "2020-06-15T00:00:00.000".  Apparently the GPL is quite picky about parameters...
I also changed the line size and shape.

HTH /PR

https://en.wikipedia.org/wiki/ISO_8601

GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Date Growth
   MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA:  Date=col(source(s), name("Date"))
  DATA:  Growth=col(source(s), name("Growth"))
  GUIDE: axis(dim(1), label("Date"))
  GUIDE: axis(dim(2), label("Growth"))

  GUIDE: form.line(position("2020-06-15T00:00:00.000", *), shape(shape.dash), size(size."2px"))

  GUIDE: form.line(position(*, 0.2))
  ELEMENT: line(position(Date*Growth), missing.wings())
END GPL.


JeremyT wrote
Apologies to those who have seen this on the now disconnected SPSSX list!

I am trying to display reference lines on a date formatted axis. I am obviously not specifying the date position correctly for the line but cannot work out what it should be: your wisdom would be appreciated Syntax below generates an example with 3 form lines but only the one on the numerical y axis is shown.
cheers
Jeremy
...