{"action":"created","issue":{"url":"https://api.github.com/repos/valor-software/ng2-charts/issues/752","repository_url":"https://api.github.com/repos/valor-software/ng2-charts","labels_url":"https://api.github.com/repos/valor-software/ng2-charts/issues/752/labels{/name}","comments_url":"https://api.github.com/repos/valor-software/ng2-charts/issues/752/comments","events_url":"https://api.github.com/repos/valor-software/ng2-charts/issues/752/events","html_url":"https://github.com/valor-software/ng2-charts/issues/752","id":223199813,"node_id":"MDU6SXNzdWUyMjMxOTk4MTM=","number":752,"title":"Ng2-Charts does not provide a mechanism to add plugins to underlying chart.js instance.","user":{"login":"grahammutter","id":5950503,"node_id":"MDQ6VXNlcjU5NTA1MDM=","avatar_url":"https://avatars3.githubusercontent.com/u/5950503?v=4","gravatar_id":"","url":"https://api.github.com/users/grahammutter","html_url":"https://github.com/grahammutter","followers_url":"https://api.github.com/users/grahammutter/followers","following_url":"https://api.github.com/users/grahammutter/following{/other_user}","gists_url":"https://api.github.com/users/grahammutter/gists{/gist_id}","starred_url":"https://api.github.com/users/grahammutter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grahammutter/subscriptions","organizations_url":"https://api.github.com/users/grahammutter/orgs","repos_url":"https://api.github.com/users/grahammutter/repos","events_url":"https://api.github.com/users/grahammutter/events{/privacy}","received_events_url":"https://api.github.com/users/grahammutter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-04-20T21:03:53Z","updated_at":"2018-11-15T14:33:52Z","closed_at":null,"author_association":"NONE","body":"Some of the beauty of chart.js is how extensible it's behaviors are with feature plugins, which currently cannot be set via ng2-charts. An interface to set custom plugins would allow greater customization of the charts.\r\n\r\nI will begin work on this ~April 26th."},"comment":{"url":"https://api.github.com/repos/valor-software/ng2-charts/issues/comments/439060266","html_url":"https://github.com/valor-software/ng2-charts/issues/752#issuecomment-439060266","issue_url":"https://api.github.com/repos/valor-software/ng2-charts/issues/752","id":439060266,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTA2MDI2Ng==","user":{"login":"abannsunny","id":27024161,"node_id":"MDQ6VXNlcjI3MDI0MTYx","avatar_url":"https://avatars1.githubusercontent.com/u/27024161?v=4","gravatar_id":"","url":"https://api.github.com/users/abannsunny","html_url":"https://github.com/abannsunny","followers_url":"https://api.github.com/users/abannsunny/followers","following_url":"https://api.github.com/users/abannsunny/following{/other_user}","gists_url":"https://api.github.com/users/abannsunny/gists{/gist_id}","starred_url":"https://api.github.com/users/abannsunny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abannsunny/subscriptions","organizations_url":"https://api.github.com/users/abannsunny/orgs","repos_url":"https://api.github.com/users/abannsunny/repos","events_url":"https://api.github.com/users/abannsunny/events{/privacy}","received_events_url":"https://api.github.com/users/abannsunny/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T14:33:52Z","updated_at":"2018-11-15T14:33:52Z","author_association":"NONE","body":"> What I did was register the custom plugin **globally**, with a specific id. then, in chart instance **options**, disable the plugin by id.\r\n> \r\n> example:\r\n> \r\n> `\r\n> // implement your own hooks here\r\n> let chartPlugin = {\r\n> id: 'plugin1',\r\n> beforeInit(chartInstance) {\r\n> // implement your own\r\n> },\r\n> afterDatasetsDraw: (chartInstance) => {\r\n> // implement your own\r\n> },\r\n> destroy: (chartInstance) => {\r\n> // implement your own\r\n> }\r\n> };\r\n> \r\n> ```\r\n> // to prevent multiple registration. can also move the register part to a service\r\n> if (!Chart.pluginService.getAll().filter(p => p.id === 'plugin1')[0]) {\r\n>   Chart.pluginService.register(this.chartPlugin);\r\n> }\r\n> \r\n> // if you want to exclude this plugin for a specific chart \r\n> ```\r\n> let chartOptions = {\r\n> plugins: {\r\n> plugin1: false\r\n> }\r\n> };\r\n> `\r\n\r\nThis worked perfectly for me!! thank you"}}
{"actor":{"display_login":"abannsunny"}}