Here is an example below. Paste the syntax for whatever bar chart you are making (using the Chart Builder). Then in the ELEMENT line, put
, color.interior(<Your X Variable>)
This will color all the bars different colors. To make one a specific color and the rest the same, see the SCALE: cat line. Since the bars already have labels, I also suppress the superfluous legend in the GUIDE: legend line.
*************************************************************.
DATA LIST FREE / Cat (A1).
BEGIN DATA
A A A B B C
END DATA.
DATASET NAME Bars.
*Pasted graph output.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=Cat COUNT()[name="COUNT"] MISSING=LISTWISE
REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: Cat=col(source(s), name("Cat"), unit.category())
DATA: COUNT=col(source(s), name("COUNT"))
GUIDE: axis(dim(1), label("Cat"))
GUIDE: axis(dim(2), label("Count"))
SCALE: linear(dim(2), include(0))
ELEMENT: interval(position(Cat*COUNT), shape.interior(shape.square))
END GPL.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=Cat COUNT()[name="COUNT"] MISSING=LISTWISE
REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: Cat=col(source(s), name("Cat"), unit.category())
DATA: COUNT=col(source(s), name("COUNT"))
GUIDE: axis(dim(1), label("Cat"))
GUIDE: axis(dim(2), label("Count"))
GUIDE: legend(aesthetic(aesthetic.color), null())
SCALE: linear(dim(2), include(0))
SCALE: cat(aesthetic(aesthetic.color), map(("A",color.red),("B",color.grey),("C",color.grey)))
ELEMENT: interval(position(Cat*COUNT), shape.interior(shape.square), color.interior(Cat))
END GPL.
*************************************************************.