|
|
Sorry for the repost but I responded to a previous question instead creating a new one.
Hello,
I want to be able to use syntax to create all the dual y axis bar charts so that I do not have to go one by one. Here is what I try but on the second chart it says that I have to rerun the ggraph procedure. How do I use on GGRAPH procedure to create multiple charts for each column of data.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=Questions MEAN(Alaska)[name="MEAN_Alaska"]
MEAN(National)[name="MEAN_National"]
MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: Questions=col(source(s), name("Questions"), unit.category())
DATA: Questions=col(source(s), name("Questions"), unit.category())
DATA: MEAN_Alaska=col(source(s), name("MEAN_Alaska"))
DATA: MEAN_National=col(source(s), name("MEAN_National"))
GUIDE: axis(dim(1), label("Questions"))
GUIDE: axis(scale(y1), delta(1), label("Mean Alaska"), color( color."3E58AC"))
GUIDE: axis(scale(y2), delta(1), label("Mean National"), color( color."2EB848"), opposite())
SCALE: cat(dim(1))
SCALE: y1 = linear(dim(2), min(1), max(5), origin(1))
SCALE: y2 = linear(dim(2), min(1), max(5), origin(1))
ELEMENT: interval(position(Questions*MEAN_Alaska), shape.interior( shape.square), color.interior(color."3E58AC"), scale(y1))
ELEMENT: line(position(Questions*MEAN_National), missing.wings(), color.interior(color."2EB848"), scale(y2))
END GPL.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: Questions=col(source(s), name("Questions"), unit.category())
DATA: Questions=col(source(s), name("Questions"), unit.category())
DATA: MEAN_Alaska=col(source(s), name("MEAN_Alaska"))
DATA: MEAN_National=col(source(s), name("MEAN_National"))
GUIDE: axis(dim(1), label("Questions"))
GUIDE: axis(scale(y1), delta(1), label("Mean Alaska"), color( color."3E58AC"))
GUIDE: axis(scale(y2), delta(1), label("Mean National"), color( color."2EB848"), opposite())
SCALE: cat(dim(1))
SCALE: y1 = linear(dim(2), min(1), max(5), origin(1))
SCALE: y2 = linear(dim(2), min(1), max(5), origin(1))
ELEMENT: interval(position(Questions*MEAN_Alaska), shape.interior( shape.square), color.interior(color."3E58AC"), scale(y1))
ELEMENT: line(position(Questions*MEAN_National), missing.wings(), color.interior(color."2EB848"), scale(y2))
END GPL.
|