简体   繁体   中英

How to add tooltip background in google chart

To apply the tool-tip background in Google chart,I tried the following CSS code

path
{
    fill: #000;
}

But this affected the whole google graph..

在此处输入图片说明

How to solve this without using html?

Have you tried to apply for the div.google-visualization-tooltip class ?

And I think you have to also enable the isHtml option on the tooltip

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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