*SPSS syntax example by www.spss-tutorials.com.

*Data editing results in data19.sav.

*From Graphs => Legacy Dialogs => Bar => Simple.

GRAPH
/BAR(SIMPLE)=PCT BY sector
/PANEL COLVAR=Year COLOP=CROSS./*Wrong percentages => percentage of total instead of year.

GRAPH
/BAR(SIMPLE)=CUPCT BY sector
/PANEL COLVAR=Year COLOP=CROSS./*Wrong percentages again, not sure what percentages are...

*For right cumulative percentages, run.

temporary.
select if year = '2011'.

title 'Only 2011 respondents in table below'.

frequencies sector.

*Right way, but separate charts.

sort cases by year.

split file by year.

GRAPH
/BAR(SIMPLE)=CUPCT BY sector.

split file off.

*From Graphs => chart builder. Correct percentages in single graph but no cumulative percentages available...

GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=sector COUNT()[name="COUNT"] Year MISSING=LISTWISE
    REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: sector=col(source(s), name("sector"), unit.category())
DATA: COUNT=col(source(s), name("COUNT"))
DATA: Year=col(source(s), name("Year"), unit.category())
GUIDE: axis(dim(1), label("Primary Sector"))
GUIDE: axis(dim(2), label("Percent"))
GUIDE: axis(dim(3), label("Year"), opposite())
SCALE: cat(dim(1), include("1", "2", "3", "4", "5", "6"))
SCALE: linear(dim(2), include(0))
ELEMENT: interval(position(summary.percent(sector*COUNT*Year, base.all())),
    shape.interior(shape.square))
END GPL.