I have a morris.js bar graph. I want to place count
on top of this graph. I looked into morris.js bar doc, could not find any.
On hover it should display
I find better to pass via jQuery to an empty p
This is the final result: Final Result
This is my code:
HTML
JS Below the chart code. Remember to change theData variable to the one you're using in your code.
var b=1;
jQuery('rect').each(function (i) {
$('p.num'+b).text(theData[i].value);
b++;
});
CSS
.numero{
text-align: center;
font-size: 18px !important;
font-weight: 600 !important;
}
I also have added a class to each color.
Hope this helps anybody :) Happy coding!