【问题标题】:Customize Google Charts Gantt tooltip自定义谷歌图表甘特图工具提示
【发布时间】:2016-02-20 02:54:09
【问题描述】:

我尝试自定义甘特谷歌图表的工具提示,但似乎不适用

我添加了:

 data.addColumn({type: 'string', role: 'tooltip'});

和选项

tooltip: {isHtml: true},
legend: 'none'

但它似乎不起作用。 下面是由谷歌提供并由我如上所述改编的实现。 知道为什么它不起作用吗?

https://jsfiddle.net/uped4teh/1/

【问题讨论】:

    标签: javascript charts google-visualization jsapi


    【解决方案1】:

    在 google 文档中,我们有 “Google Charts 会自动为所有核心图表创建工具提示” 这意味着你的包应该像 corechart google.charts.load('current', {'packages':['corechart']}); 而不是你的 google.charts.load('current', {'packages':['gantt']}); 甘特图不支持自定义工具提示,请更改时间线以使用 corechart 包

    【讨论】:

      【解决方案2】:

      Google Chart Gantt HTML 工具提示尚不可用,

      HTML 工具提示目前支持以下图表类型: AreaChart、BarChart、CalendarChart、CandlestickChart、ColumnChart、ComboChart、LineChart、PieChart、Sankey Diagrams、ScatterChart、Timeline。

      https://developers.google.com/chart/interactive/docs/customizing_tooltip_content#supported-charts

      【讨论】:

        【解决方案3】:

        我正在使用同一张图表,但我遇到了几个问题... Html 工具提示功能不适用于 google 甘特图,您可以在我复制的链接中的“支持的图表”部分阅读它...

        https://developers.google.com/chart/interactive/docs/customizing_tooltip_content

        祝你好运

        如果我的回答对你有帮助,请告诉我

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2021-12-10
          • 1970-01-01
          • 2019-06-17
          • 2015-11-22
          • 2013-03-20
          • 1970-01-01
          相关资源
          最近更新 更多