{"action":"created","issue":{"url":"https://api.github.com/repos/chartjs/Chart.js/issues/3271","repository_url":"https://api.github.com/repos/chartjs/Chart.js","labels_url":"https://api.github.com/repos/chartjs/Chart.js/issues/3271/labels{/name}","comments_url":"https://api.github.com/repos/chartjs/Chart.js/issues/3271/comments","events_url":"https://api.github.com/repos/chartjs/Chart.js/issues/3271/events","html_url":"https://github.com/chartjs/Chart.js/pull/3271","id":175529657,"number":3271,"title":"Added \"onHover\" functionality for legend","user":{"login":"d4popov","id":20777220,"avatar_url":"https://avatars.githubusercontent.com/u/20777220?v=3","gravatar_id":"","url":"https://api.github.com/users/d4popov","html_url":"https://github.com/d4popov","followers_url":"https://api.github.com/users/d4popov/followers","following_url":"https://api.github.com/users/d4popov/following{/other_user}","gists_url":"https://api.github.com/users/d4popov/gists{/gist_id}","starred_url":"https://api.github.com/users/d4popov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d4popov/subscriptions","organizations_url":"https://api.github.com/users/d4popov/orgs","repos_url":"https://api.github.com/users/d4popov/repos","events_url":"https://api.github.com/users/d4popov/events{/privacy}","received_events_url":"https://api.github.com/users/d4popov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-09-07T15:14:18Z","updated_at":"2016-09-08T11:46:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chartjs/Chart.js/pulls/3271","html_url":"https://github.com/chartjs/Chart.js/pull/3271","diff_url":"https://github.com/chartjs/Chart.js/pull/3271.diff","patch_url":"https://github.com/chartjs/Chart.js/pull/3271.patch"},"body":"* core.legend.js\r\n   - Created an \"onHover\" property in the legend object that will hold a user defined function (default is null)\r\n   - Modified the \"handleEvent\" function of the legend to check if the event passed to it is a \"click/mouseup\" or a \"mousemove\" to determine whether to call the \"onClick\" or the \"onHover\" event (this is for the sake of reusing the legend hitbox calculations)\r\n   - The \"onHover\" event will receive the same parameters as the \"onClick\" (the \"event\" itself and the \"legendItem\" the user is hovering over)\r\n\r\n* core.controller.js\r\n   - Added a \"mousemove\" event to the \"eventHandler\" of the controller and put the new legend \"onHover\" logic in it\r\n   - Also moved the original chart \"onHover\" functionality under the \"mousemove\" clause too in order to put the hover events in one place for consistency."},"comment":{"url":"https://api.github.com/repos/chartjs/Chart.js/issues/comments/245572795","html_url":"https://github.com/chartjs/Chart.js/pull/3271#issuecomment-245572795","issue_url":"https://api.github.com/repos/chartjs/Chart.js/issues/3271","id":245572795,"user":{"login":"simonbrunel","id":3874900,"avatar_url":"https://avatars.githubusercontent.com/u/3874900?v=3","gravatar_id":"","url":"https://api.github.com/users/simonbrunel","html_url":"https://github.com/simonbrunel","followers_url":"https://api.github.com/users/simonbrunel/followers","following_url":"https://api.github.com/users/simonbrunel/following{/other_user}","gists_url":"https://api.github.com/users/simonbrunel/gists{/gist_id}","starred_url":"https://api.github.com/users/simonbrunel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonbrunel/subscriptions","organizations_url":"https://api.github.com/users/simonbrunel/orgs","repos_url":"https://api.github.com/users/simonbrunel/repos","events_url":"https://api.github.com/users/simonbrunel/events{/privacy}","received_events_url":"https://api.github.com/users/simonbrunel/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T11:46:46Z","updated_at":"2016-09-08T11:46:46Z","body":"Forgot one important thing: can you update the [document](https://github.com/chartjs/Chart.js/blob/master/docs/01-Chart-Configuration.md#legend-configuration) to add the new `onHover` callback?"}}
{"actor":{"display_login":"simonbrunel"}}