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

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

问题描述

以下问题几乎完全描述了我想要...

The following question almost entirely describes what I'm trying to to...

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

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

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

谢谢.

推荐答案

Google 图表工具中的新功能还没有分别进入 GWT 可视化 API 和包装器.
我实际上不确定 GWT API 是否会更新.但是,您始终可以自己实现这些功能.

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.

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

Depending on how you create your DataTable (Programmatically or by the backend) you can:

  • 以编程方式:您可以扩展 DataTableAbstractDataTable 类并通过 JSNI(即addColumn(type, role)等.查看AbstractDataTable).
  • 来自后端的 JSON:您可以在后端创建适当的 DataTable JSON 结构,然后调用 DataTable.create() 并将其传递给 draw() 方法,无需任何代码修改.(我还没有测试过,但它应该可以工作,因为 DataTable 只是一个 JavaScriptObject)
  • 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)

顺便说一句:GWT 可视化 API 的最新版本实际上是 (1.1.2)

BTW: the latest version of the GWT Visualization API is actually (1.1.2)

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

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