You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now I am doing the simplest thing by trying to turn all the legend rectangles red, but it isnt working.
My ultimate goal and sole purpose of this thing is to actually change the mouse cursor to 'pointer' when the user is hovering over the legend. Currently the Chart.js library has no such functionality as hover over the legend. At its default state the legend has no indication whatsoever that is clickable, so users who are new to this won't realize that straignt away. I am trying to make it as user friendly as possible and a simple cursor change will be enough of a visual cue to help them realize that they can interact with the legend.
Any suggestions?
EDIT:
I figured it out. I was expectingthe chart to automaticaly substitute the default legend with the new one, but it doesnt do that and I found out that I have to call the generateLegend() method by myself. It was confusing because I thought the custom legend functionality is broken. I guess this solves it. It would be nice however if the chart could draw the legend automatically using the overriden legendCallback function instead of hte user having to call generateLegend manually.
The text was updated successfully, but these errors were encountered:
I am having trouble with creating a custom legend for my project. I can't seem to be able to override the legendCallback for the chart.
Here is an example with one of the samples: https://jsfiddle.net/2a59cby8/
For now I am doing the simplest thing by trying to turn all the legend rectangles red, but it isnt working.
My ultimate goal and sole purpose of this thing is to actually change the mouse cursor to 'pointer' when the user is hovering over the legend. Currently the Chart.js library has no such functionality as hover over the legend. At its default state the legend has no indication whatsoever that is clickable, so users who are new to this won't realize that straignt away. I am trying to make it as user friendly as possible and a simple cursor change will be enough of a visual cue to help them realize that they can interact with the legend.
Any suggestions?
EDIT:
I figured it out. I was expectingthe chart to automaticaly substitute the default legend with the new one, but it doesnt do that and I found out that I have to call the generateLegend() method by myself. It was confusing because I thought the custom legend functionality is broken. I guess this solves it. It would be nice however if the chart could draw the legend automatically using the overriden legendCallback function instead of hte user having to call generateLegend manually.
The text was updated successfully, but these errors were encountered: