ialexei / gwt-charts

Automatically exported from code.google.com/p/gwt-charts
0 stars 0 forks source link

More support for Role #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

In the Google API (https://developers.google.com/chart/interactive/docs/roles) 
it is possible to write:
data.addColumn({type:'string', role:'annotation'});

It seems that RoleType can only be used by DataColumn, and so by a DataLiteral 
object with setCols(), to build the table directly from JSON datas, but not 
applicable for the example above.

It is possible to add this by adding a new class, for example ColumnDescription 
(see attached file), and to add the following function to DataTable:

public final native int addColumn(ColumnDescription description) /*-{
    return this.addColumn(description);
}-*/;

Then you can add in your code:
ColumnDescription annotatedColumn = ColumnDescription.create();
annotatedColumn.setType(ColumnType.STRING);
annotatedColumn.setRole(RoleType.ANNOTATION);
dataTable.addColumn(annotatedColumn);

Original issue reported on code.google.com by phili...@gonday.com on 27 Nov 2012 at 1:27

Attachments:

GoogleCodeExporter commented 8 years ago
There's indeed a missing method in DataTable.
The DataColumn object is a candidate for defining the column roles, but I need 
to investigate it further.

Original comment by rglafo...@gmail.com on 27 Nov 2012 at 9:36

GoogleCodeExporter commented 8 years ago
Used DataColumn as a solution.
Waiting release.

Original comment by rglafo...@gmail.com on 27 Nov 2012 at 11:39

GoogleCodeExporter commented 8 years ago

Original comment by rglafo...@gmail.com on 7 Dec 2012 at 12:06