here (another) sample
:- use_module(library(pce)).
:- use_module(library(plot/barchart)).
:- use_module(library(autowin)).
test_barchart :-
new(W, picture),
send(W, display, new(BC, bar_chart(vertical,0,200))),
forall(member(Name/Height/Color,
[x/100/red, y/150/green, z/80/blue, v/50/yellow]),
( new(B, bar(Name, Height)),
send(B, colour(Color)),
send(BC, append, B)
)),
send(W, open).
that yields
You can inspect XPCE objects from Help\XPCE Manual\Browsers\Class Browser...