简体   繁体   English

如何在Google图表中添加工具提示背景

[英]How to add tooltip background in google chart

To apply the tool-tip background in Google chart,I tried the following CSS code 为了在Google图表中应用工具提示背景,我尝试了以下CSS代码

path
{
    fill: #000;
}

But this affected the whole google graph.. 但这影响了整个谷歌图。

在此处输入图片说明

How to solve this without using html? 不使用html如何解决此问题?

Have you tried to apply for the div.google-visualization-tooltip class ? 您是否尝试过div.google-visualization-tooltip类?

And I think you have to also enable the isHtml option on the tooltip 而且我认为您还必须在工具提示上启用isHtml选项

var chart_options = {
    title: 'London Olympics Medals',
    colors: ['#FFD700', '#C0C0C0', '#8C7853'],
    tooltip: { isHtml: true }
};

https://developers.google.com/chart/interactive/docs/customizing_tooltip_content#customizing-html-content https://developers.google.com/chart/interactive/docs/customizing_tooltip_content#customizing-html-content

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM