我试图自定义甘特谷歌图表的工具提示,它似乎并不适用
我已经添加 :
data.addColumn({type: 'string', role: 'tooltip'});
和选项
tooltip: {isHtml: true},
legend: 'none'
但这似乎不起作用。下面是由谷歌提供并由我如上所述改编的实现。知道为什么它不起作用吗?
我试图自定义甘特谷歌图表的工具提示,它似乎并不适用
我已经添加 :
data.addColumn({type: 'string', role: 'tooltip'});
和选项
tooltip: {isHtml: true},
legend: 'none'
但这似乎不起作用。下面是由谷歌提供并由我如上所述改编的实现。知道为什么它不起作用吗?
我正在使用同一张图表,但遇到了几个问题... Html 工具提示功能不适用于 google 甘特图,您可以在我复制的链接中的“支持的图表”部分中了解它...
https://developers.google.com/chart/interactive/docs/customizing_tooltip_content
好运
让我知道我的回答是否对您有帮助
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
在谷歌文档中,我们有“谷歌图表自动为所有核心图表创建工具提示” ,这意味着你的包应该是核心图表,如 google.charts.load('current', {'packages':['corechart']}); 而不是你 的 google.charts.load('current', {'packages':['gantt']}); 甘特图不支持自定义工具提示,更改时间线以使用 corechart 包