The following question almost entirely describes what I'm trying to to...
Add custom text to Google Visualization tooltip
... basically to add extra information to google-viz tooltips. The accepted answer looked pretty good but I'm using the GWT API. From the look of the latest version (1.1) data table doesn't support this...
...
is anyone aware of any fix or workaround for this?
Thanks.
Based on Ümit's answer I was able to do this very easily using JSNI, I thought I'd post some sample code for anyone else who comes across this.
To keep things ultra-simple instead of extending the DataTable class I added the following into my client side class which generates the chart:
Note this is JNSI, hence the commenting / brackets which seem odd to the un-initiated.
I can then call that on the data table:
And the tooltips can be added along with the data for each row like this:
Well the new features in the google charting tools haven't made their way into the the GWT visualization API and wrapper respectively.
I am actually not sure if the GWT API's will be updated at all. However you can always implement these features yourself.
Depending on how you create your DataTable (Programmatically or by the backend) you can:
addColumn(type, role)
, etc. Checkout the source code for AbstractDataTable).DataTable
JSON structure on the backend and then just call DataTable.create() and pass it to thedraw()
method without any code modifications. (I haven't tested it but it should work as DataTable is just a JavaScriptObject)BTW: the latest version of the GWT Visualization API is actually (1.1.2)
You can also add more information to the tooltip using
instead of data.setValue(...).