I'm using gwt-visualization (a wrapper around Chart Tools). I have a ComboChart that includes two bar charts (stacked) and a line chart, and I want to add an annotation
and annotationText
to some rows.
The DataTable
is defined like this:
private DataTable buildData() {
DataTable data = DataTable.create();
data.addColumn(ColumnType.STRING, "Day");
data.addColumn(ColumnType.NUMBER, "Domain");
data.addColumn(ColumnType.NUMBER, "Domain (Source 1)");
data.addColumn(ColumnType.NUMBER, "Domain (Source 2)");
addAnnotationColumn(data);
return data;
}
private native void addAnnotationColumn(DataTable data) /*-{
data.addColumn({
type : 'string',
role : 'annotation'
});
data.addColumn({
type : 'string',
role : 'annotationText'
});
}-*/;
And then the chart options...
private ComboChart.Options createComboOptions(String title) {
ComboChart.Options options = ComboChart.createComboOptions();
Series line = Series.create();
line.setType(Type.LINE);
options.setSeries(0, line);
Series bars1 = Series.create();
bars1.setType(Type.BARS);
options.setSeries(1, bars1);
Series bars2 = Series.create();
bars2.setType(Type.BARS);
options.setSeries(2, bars2);
options.setIsStacked(true);
return options;
}
Which results in something like this:
What I need is to add annotations to some rows in the line series, or in other words how to set roles in a ComboChart, but I can't seem to find any documentation on how to do it in gwt (or even how to do it in pure JS in a ComboChart). Help?