{"action":"created","issue":{"url":"https://api.github.com/repos/gionkunz/chartist-js/issues/362","labels_url":"https://api.github.com/repos/gionkunz/chartist-js/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/gionkunz/chartist-js/issues/362/comments","events_url":"https://api.github.com/repos/gionkunz/chartist-js/issues/362/events","html_url":"https://github.com/gionkunz/chartist-js/issues/362","id":90445986,"number":362,"title":"Updating chart inside 'created' event listener","user":{"login":"alexstanbury","id":809537,"avatar_url":"https://avatars.githubusercontent.com/u/809537?v=3","gravatar_id":"","url":"https://api.github.com/users/alexstanbury","html_url":"https://github.com/alexstanbury","followers_url":"https://api.github.com/users/alexstanbury/followers","following_url":"https://api.github.com/users/alexstanbury/following{/other_user}","gists_url":"https://api.github.com/users/alexstanbury/gists{/gist_id}","starred_url":"https://api.github.com/users/alexstanbury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexstanbury/subscriptions","organizations_url":"https://api.github.com/users/alexstanbury/orgs","repos_url":"https://api.github.com/users/alexstanbury/repos","events_url":"https://api.github.com/users/alexstanbury/events{/privacy}","received_events_url":"https://api.github.com/users/alexstanbury/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-23T17:35:24Z","updated_at":"2015-06-24T22:26:04Z","closed_at":null,"body":"I'm trying to amend the top padding of my chart in a plugin inside the 'created' event listener but update() does not seem to work.\r\n\r\nHere's some code:\r\n\r\n```\r\nfunction myPlugin(options) {\r\n            return function myPlugin(chart) {\r\n\r\n                var theChart = chart;\r\n\r\n                chart.on('created', function (data) {\r\n                        theChart.options.chartPadding.top = 160;\r\n                        theChart.update();\r\n                });\r\n            };\r\n}\r\n```\r\nThe property is updated ok, but there is no visual update - Any ideas?"},"comment":{"url":"https://api.github.com/repos/gionkunz/chartist-js/issues/comments/115030212","html_url":"https://github.com/gionkunz/chartist-js/issues/362#issuecomment-115030212","issue_url":"https://api.github.com/repos/gionkunz/chartist-js/issues/362","id":115030212,"user":{"login":"gionkunz","id":2203704,"avatar_url":"https://avatars.githubusercontent.com/u/2203704?v=3","gravatar_id":"","url":"https://api.github.com/users/gionkunz","html_url":"https://github.com/gionkunz","followers_url":"https://api.github.com/users/gionkunz/followers","following_url":"https://api.github.com/users/gionkunz/following{/other_user}","gists_url":"https://api.github.com/users/gionkunz/gists{/gist_id}","starred_url":"https://api.github.com/users/gionkunz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gionkunz/subscriptions","organizations_url":"https://api.github.com/users/gionkunz/orgs","repos_url":"https://api.github.com/users/gionkunz/repos","events_url":"https://api.github.com/users/gionkunz/events{/privacy}","received_events_url":"https://api.github.com/users/gionkunz/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T22:26:04Z","updated_at":"2015-06-24T22:26:04Z","body":"This would cause an infinite event loop as `update()` will actually trigger an other `created` event.\r\n\r\nIf you'd like to add the padding top to the chart before it gets rendered use the `data` event that is triggered before the data is used / processed."}}