I'm doing a comparison bar chart and would like the bars to be 2
different colors, but can't get it to work. Tried this as last resort
but didn't work (just picks last color).
private Widget addBarChart() {
HorizontalPanel hp = new HorizontalPanel();
hp.setBorderWidth(1);
FlowPanel fp = new FlowPanel();
ChartWidget chart = new ChartWidget();
ChartData cd = new ChartData("Me and My Buddy","font-size: 14px;
font-family: Verdana; text-align: center;");
cd.setBackgroundColour("#ffffff");
XAxis xa = new XAxis();
xa = new XAxis();
xa.setLabels("Buddy Weight","My Weight","Buddy Calories","My
Calories","Buddy Exercise","My Exercise");
xa.setMax(6);
cd.setXAxis(xa);
YAxis ya = new YAxis();
ya = new YAxis();
ya.setSteps(10);
ya.setMin(-100);
ya.setMax(100);
cd.setYAxis(ya);
BarChart bchart = new BarChart(BarStyle.GLASS);
bchart.setColour("#FF6600");
bchart.setTooltip("$#val#");
bchart.addValues(-25);
bchart.setColour("#0066CC");
bchart.addValues(25);
bchart.setColour("#FF6600");
bchart.addValues(-10);
bchart.setColour("#0066CC");
bchart.addValues(40);
bchart.setColour("#FF6600");
bchart.addValues(16);
bchart.setColour("#0066CC");
bchart.addValues(66);
cd.addElements(bchart);
chart.setSize("650", "250");
chart.setJsonData(cd.toString());
HTML label = new HTML("<u>Success Percentage</u>");
label.setWidth("100%");
label.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
fp.add(label);
fp.add(chart);
hp.add(fp);
return hp;
}
--
You received this message because you are subscribed to the Google Groups "OFCGWT" group.
To post to this group, send email to
ofc...@googlegroups.com.
To unsubscribe from this group, send email to
ofcgwt+un...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/ofcgwt?hl=en.