How to disable donut section selection of Morris.js chart on mouse hover event and allow selection only on chart section click?
Looking at the docs for Morris.Donut()
, it appears that this is not an option.
If you reallyyyy want to make it behave this way, you can dig into the Morris.js
file itself. Modifying line 1918 (Morris.js on github) from:
seg.on('hover', this.select);
to:
seg.on('click', this.select);
This one line change will accomplish what you want as shown in this jsFiddle.
You will now have to distribute this version of Morris.js with your site. You will no longer be able to use their pre-minified version or a cdn though. You can however minify your new version yourself and distribute that.
Personally, I think this is sort of obnoxious and should be a configurable option in Morris.js
P.S. It has a BSD lisence but I'm no law expert. You should check with someone more knowledgeable about software lisencing before running this modified code in a production environment.