xpce

How can I make a bar chart (bar graph) in Prolog GUI (XPCE) programming?

纵饮孤独 提交于 2019-12-24 17:09:58
问题 I'm trying to make a barchart by using XPCE in Proglog libraries. Though I found some materials but I cannot execute it right away. The code is as below. barchart :- barchart(vertical). barchart(HV) :- new(W, picture), active_classes(Classes), length(Classes, N), required_scale(Classes, Scale), send(W, display, new(BC, bar_chart(HV, 0, Scale, 200, N))), forall(member(class(Name, Created, Freed), Classes), send(BC, append, bar_group(Name, bar(created, Created, green), bar(freed, Freed, red))))