]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Fix 3267 Add "onHover" functionality for legend (#3271)
authorLubomir Sotirov <lubomir.sotirov@stockinthechannel.com>
Wed, 7 Sep 2016 14:59:33 +0000 (16:59 +0200)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Thu, 8 Sep 2016 12:42:42 +0000 (14:42 +0200)
commit38f85c98b5821091c44df6bf07da937b3b1a464f
tree1872da9309ebcc2a6c2a6fd28887968b0ae76ae4
parent52cdff5fc100eda0e7b28bde311a20b91626fe2a
Fix 3267 Add "onHover" functionality for legend (#3271)

Add "onHover" to the legend options that will hold a user defined function (default is null) and called when a "mousemove" event is registered on top of a label item, with same parameters as the "onClick" option.

Also introduced logic that determines if the type of event passed to the legend "handleEvent" function is one we can handle. Currently allowing "click" and "mousemove" events. If the event is not one of those we stop the function execution (this is for the sake of reusing the legend hitbox calculations).
docs/01-Chart-Configuration.md
src/core/core.controller.js
src/core/core.legend.js
test/core.legend.tests.js