将自定义文本添加到Google可视化工具提示(使用GWT API) [英] Add custom text to Google Visualization tooltip (using GWT API)

查看:101
本文介绍了将自定义文本添加到Google可视化工具提示(使用GWT API)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的问题几乎完全描述了我想要做什么...

向Google可视化工具提示添加自定义文本



...基本上添加额外的信息google-viz工具提示。接受的答案看起来不错,但我使用的是GWT API。从最新版本(1.1)的数据表来看,并不支持... ...



http://gwt-google-apis.googlecode.com/svn/javadoc /visualization/1.1/com/google/gwt/visualization/client/DataTable.html



...



是否有人知道有任何解决方法或解决方法?



谢谢。

解决方案

那么谷歌图表工具中的新功能并没有分别进入到GWT可视化API和包装中。

我真的不确定GWT API是否会根本不需要更新。
但是,您始终可以自己实现这些功能。



根据您创建DataTable的方式(以编程方式或通过后端),您可以:


  • 以编程方式:您可以扩展 DataTable AbstractDataTable 类,并通过 JSNI (即 addColumn(类型,角色)等)。检出 AbstractDataTable )。
  • 来自后端的JSON :您可以创建适当的 DataTable JSON结构在后端,然后只需调用 DataTable.create(),并将其传递给 draw()方法任何代码修改。 (我还没有测试过,但它应该可以工作,因为DataTable只是一个JavaScriptObject)


    BTW:最新版本的GWT可视化API实际上是( 1.1.2


    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...

    http://gwt-google-apis.googlecode.com/svn/javadoc/visualization/1.1/com/google/gwt/visualization/client/DataTable.html

    ...

    is anyone aware of any fix or workaround for this?

    Thanks.

    解决方案

    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:

    • Programmatically: you could extend the DataTable or AbstractDataTable class and implement the missing features and functions via JSNI (i.e. addColumn(type, role), etc. Checkout the source code for AbstractDataTable).
    • JSON from the backend: you could just create the appropriate DataTable JSON structure on the backend and then just call DataTable.create() and pass it to the draw() 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)

    这篇关于将自定义文本添加到Google可视化工具提示(使用GWT API)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆