[Chartjs]-How to make the whole <canvas> element in Chart.js V3.7.0 display cursor as pointer on hover?

5👍

In CSS, you need canvas:hover{cursor: pointer}. The canvas:hover will run the code inside when the cursor is hovering over the element. The cursor: pointer will tell the cursor to become a pointer. For more information, go here for other cursor types and here for hover selector.

Or if you don’t have a CSS file, you can do this: <canvas id="myChart" style="cursor: pointer"></canvas> . That will do the same thing as explained above.

Leave a comment