mdbootstrap / material-design-for-bootstrap

Important! A new UI Kit version for Bootstrap 5 is available. Access the latest free version via the link below.
https://mdbootstrap.com/docs/standard/
MIT License
9.34k stars 1.15k forks source link

pointer cursor when hovering legend on charts #155

Closed robdll closed 6 years ago

robdll commented 6 years ago

Expected behavior

When mouse hovering any legend item, i'd expect to see a cursor: pointer

Actual behavior

When mouse hovering any legend item, cursor is default

Martussky commented 6 years ago

Hi, we will look at this and probably change in the future.

Martussky commented 6 years ago

Hi, if you want to have a pointer cursor on hover in a chart, add to the "options" the following code:

legend: {
            onHover: function(e) {
              e.target.style.cursor = 'pointer';
            }
          },
          hover: {
            onHover: function(e) {
              var point = this.getElementAtEvent(e);
              if (point.length) e.target.style.cursor = 'pointer';
              else e.target.style.cursor = 'default';
            }
          }

Best, Marta