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.