Shiny - googlevis:gvisPieChart的工具提示 [英] Shiny - googlevis: Tooltips for gvisPieChart

查看:134
本文介绍了Shiny - googlevis:gvisPieChart的工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Googlevis饼图创建自定义工具提示。

I am trying to create custom tooltips for a googlevis pie chart.

我发现通过googleVis使用角色,但我无法将类似的概念复制到饼图。请参阅下面的我试图达到此目的的一个:

I have found Using Roles via googleVis but I cannot replicate a similar concept to a pie chart. See below for one of my attempts to achive this:

df <- data.frame(year=c("a","b","g"),pop=1:3, pop.html.tooltip=c("alpha","beta","gamma"))

  plot(
    gvisPieChart(df,options=list(tooltip="{isHtml:'true'}"))
  )

此外,我发现通过googleVis使用角色无法正常工作。尽管确定性概念工作正常,但工具提示并未按dat dataframe的Sales.html.tooltip列中的定义显示。

Moreover, I found out that the first column chart example in Using Roles via googleVis is not working properly. Although the certainty concept is working fine, the tooltips are not displayed as defined in Sales.html.tooltip column of dat dataframe.

显然,除了gvisScatterChart,其他图表中的工具提示都有问题。

Apparently, I am having a problem with tooltips in every other chart apart from gvisScatterChart.

推荐答案

目前通过google可视化API不可能实现这一目标。

This is currently not possible via the google visualisation api

https://code.google.com/ p / google-visualization-api-issues / issues / detail?id = 507

例如,柱形图的工作方式为:

The way it would work with for example the column chart is:

g <- gvisColumnChart(df, xvar = "year", yvar = c("pop", "pop.html.tooltip")
                     , options=list(tooltip="{isHtml:'true'}"))
plot(g)

这篇关于Shiny - googlevis:gvisPieChart的工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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