简体   繁体   中英

How to change tooltip position in Google Charts?

I'm working on a Google chart, and I wanted to use custom HTML tooltips for it, however Google charts doesn't seem to offer any good API for positioning tooltips relative to the points on the charts, such as "top-left" or "bottom-center", that other libraries offer.

工具提示。

For instance, I'd like this tooltip to centrally above the highlighted dot, and not floating to the left. Any known way of doing that?

Since Google still doesn't offer a solution for this, I just used the CSS transform: translateX property, with a value of half the tooltip size. Not ideal, but it works.

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