New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tooltip on legend item #4023
Comments
@d1manson in general you're going about it the right way. You might be able to use the legend To show the tooltip, I think you might get away with creating a new |
OK, I see the new Chart(canvas, {
type: 'line',
data: ...,
options: {
legend: {
onHover: function(e, target){
var idx = target.datasetIndex;
console.log("legend " + idx);
}}}}); however this seems to fire for
but that doesn't seem be particularly relevant to the legends...? In terms of tooltips, could you give me a pointer to some code or docs. Thanks for the quick reply! :) |
Sorry for the delayed reply on this. I think you could make a modification to the legend plugin to trigger I think you can even patch it by overwriting |
Closing as out of date |
I want to provide a sentence or two of in-depth explanation when the user hovers over a dataset's entry in the legend.
I understand that the legend (as with the rest of the chart) is rendered on a canvas rather than with the DOM, so I have to hook into the chartjs internals. After much googling, I have got as far as:
which logs the dataset label when I hover over it in the legend. Next I need to show a tooltip.
Am I going about this in the right way so far? How do I show a tooltip?
The text was updated successfully, but these errors were encountered: