Login  Register

Re: form.line position with date-formatted axes

Posted by Bruce Weaver on Dec 20, 2022; 3:21pm
URL: http://spssx-discussion.165.s1.nabble.com/form-line-position-with-date-formatted-axes-tp5741098p5741105.html

Well done, Peder.  That cracks it.  

PRogman wrote
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.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).