Figure 1. GPL for stacked pie chart
* Open sample file Employee Data.sav.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=jobcat gender
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: jobcat = col(source(s), name("jobcat"), unit.category())
DATA: gender = col(source(s), name("gender"), unit.category())
COORD: polar(transpose())
GUIDE: axis(dim(1), null())
GUIDE: axis(dim(2), null())
GUIDE: legend(aesthetic(aesthetic.texture.pattern.interior), label("Employment Category"))
GUIDE: legend(aesthetic(aesthetic.color.interior), label("Gender"))
ELEMENT: interval.stack(position(summary.percent.count(jobcat*1, base.coordinate(dim(1)))),
texture.pattern(jobcat), color(gender), size(size."100%"))
END GPL.
Figure 2. Stacked pie chart