Custom position tooltip on top #10420
-
I am trying to make this example work: https://www.chartjs.org/docs/3.5.1/samples/tooltip/position.html because it have an option to position the tooltip on the bottom of the graph. I need to do so because I have way too much data in my graph and when I move my cursor the tooltip wiggle around too much. My biggest problem is that, even after adding type="module" to my script tag I still get the following error when I do import {Tooltip} from '/chart.js/dist/chart.js': Uncaught SyntaxError: The requested module '/chart.js/dist/chart.js' does not provide an export named 'Tooltip' And that is even after losing 3 hours trying to search on every corner of google. Thanks you so much to anyone who can help me! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Since you are using a script tag the global Chart object is made available to you. So you can just write: Chart.Tooltip.positioners.customName = customPositionerFunction; There is no need to import anything |
Beta Was this translation helpful? Give feedback.
Since you are using a script tag the global Chart object is made available to you.
So you can just write:
There is no need to import anything