[Chartjs]-Change mouse cursor to pointer in charts js

2👍

You can do that. When hovering on a specific label and changes the cursor to pointer.

 listeners: {
                enter: function(context) {

                  context.hovered = true;
                  var el = document.getElementById("myLineChart");
                  el.style.cursor = "pointer";
                  return true;
                },
                leave: function(context) {
                  context.hovered = false;
                  var el = document.getElementById("myLineChart");
                  el.style.cursor = "default";
                  return true;
                },
              },

It resets when stopping from hovering the label. I hope helps.

Leave a comment