Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chartjs - show elements in all datasets on hover using bar chart

Is there a way to show the elements together when hovering on the same x-axis of a bar chart? Same with the image below.

enter image description here

I tried hover.mode ('single', 'label' and 'x-axis')

options: {
    hover: {
        // Overrides the global setting
        mode: 'label'
    }
}

Unfortunately it did not work for some reason. Is this not possible or did I miss something?

Code here: https://jsfiddle.net/jk4bg8a2/

Thanks.

like image 853
raz Avatar asked Sep 22 '16 18:09

raz


1 Answers

The property is actually stored in tooltips like this :

options: {
    tooltips: {
        // Overrides the global setting
        mode: 'label'
    }
}

Check your updated fiddle to see it working, and here is its result :

enter image description here

like image 199
tektiv Avatar answered Sep 30 '22 14:09

tektiv