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

*1. Create Test Data.

data list free/v1 v2.
begin data
1 1 1 2 1 3 1 4 1 5 2 1 2 2 2 3 2 4 2 5 3 1 3 2 3 3 3 4 3 5 4 1 4 2 4 3 4 4 4 5 5 1 5 2 5 3 5 4 5 5
end data.

value labels v1 v2 1 'Very bad' 2 'Bad' 3 'Not good, not bad' 4 'Good' 5 'Very good'.
variable level v1 v2 (ordinal).    /*facilitates chart builder dialog later on.

set seed 1.
compute ofreq = trunc(rv.uniform(10,101)).
weight by ofreq.

*2. Check.

crosstabs v1 by v2/cells column.

*3. Chart Builder => Pasted from Menu.

GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=v2 COUNT()[name="COUNT"] v1 MISSING=LISTWISE
    REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: v2=col(source(s), name("v2"), unit.category())
DATA: COUNT=col(source(s), name("COUNT"))
DATA: v1=col(source(s), name("v1"), unit.category())
COORD: rect(dim(1,2), transpose())
GUIDE: axis(dim(1), label("v2"))
GUIDE: axis(dim(2), label("Percent"))
GUIDE: legend(aesthetic(aesthetic.color.interior), label("v1"))
SCALE: cat(dim(1), include("1.00", "2.00", "3.00", "4.00", "5.00"))
SCALE: linear(dim(2), include(0))
SCALE: cat(aesthetic(aesthetic.color.interior), include("1.00", "2.00", "3.00", "4.00", "5.00"))
ELEMENT: interval.stack(position(summary.percent(v2*COUNT, base.coordinate(dim(1)))),
    color.interior(v1), shape.interior(shape.square))
END GPL.