Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Render Tooltip outside of Canvas

Open basickarl opened this issue 7 years ago • 4 comments

Regarding: https://github.com/chartjs/Chart.js/issues/622

There is one thing one could do... In the configuration you could set some sort of boolean property, we can take this as an example name: renderTooltipsInCanvas

True would be it's current functioning. False would be... removing this functionality from the canvas and appending a div element to the root document and displaying it depending on the datapoint x/y position on the page. This wouldn't break functionality.

(one can technically do this via the custom property already, but would be nice with a default)

basickarl avatar Mar 14 '19 15:03 basickarl

Hi @basickarl , may i see your complete implementation regarding to this issue? Thanks.

BenJohnThird avatar Jul 15 '19 06:07 BenJohnThird

Hi. I have similar issue. In my graph, the tooltip overflow. I can handle that but custom tooltip, but it is overkill for small problem like that. The boolean or z-index in setting will be great.

Snímek obrazovky 2020-08-26 v 10 36 17

VasekProchazka avatar Aug 26 '20 08:08 VasekProchazka

I think this isn't something we want to pursue internally. While it's fairly straightforward, once wrappers are used into frameworks like React & Angular, maintaining our own DOM makes the integration harder. In v3, we've moved the tooltip into a plugin, so it should be quite easy to write a replacement plugin that renders in HTML or even in a specific framework.

I'm happy to answer questions if someone wants to implement such a plugin.

etimberg avatar Oct 17 '20 23:10 etimberg

I think this isn't something we want to pursue internally. While it's fairly straightforward, once wrappers are used into frameworks like React & Angular, maintaining our own DOM makes the integration harder. In v3, we've moved the tooltip into a plugin, so it should be quite easy to write a replacement plugin that renders in HTML or even in a specific framework.

I'm happy to answer questions if someone wants to implement such a plugin.

Hi! Could you help me please how can I position the tooltip absolutely ? My chart width is less then the width of tooltip and its overflow, is it possible to somehow float it from chart canvas and position outside ? Screenshot 2023-12-08 at 17 23 43

stevenKirill avatar Dec 08 '23 14:12 stevenKirill