{"action":"created","comment":{"url":"https://api.github.com/repos/Metatavu/metaform-management/pulls/comments/195056425","pull_request_review_id":128345107,"id":195056425,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTA1NjQyNQ==","diff_hunk":"@@ -43,18 +43,34 @@\n      * @param {Object} options options\n      */\n     async loadReport(slug, options) {\n-      const chartData = await this.getChartData(slug, options || {});\n-      \n+      let chartData = await this.getChartData(slug, options || {});\n+      chartData = this.processCustomOptions(chartData);\n       if (!this.chart) {\n         this.chart = new Chart(this.context, chartData);\n       } else {\n-        this.chart.type = chartData.type; \n-        this.chart.data = chartData.data; \n-        this.chart.options = chartData.options || {}; \n-        this.chart.update();\n+        this.chart.destroy();\n+        this.chart = new Chart(this.context, chartData);\n       }\n     }\n \n+    /**\n+     * Process custom options if there is any\n+     * \n+     * @param {Object} chartData\n+     */\n+    processCustomOptions(chartData) {\n+      chartData.options.scales.yAxes.forEach((y, index) => {","path":"src/js/report.js","position":26,"original_position":26,"commit_id":"2ce255813312f5f55483d6f4f0c85543c608b81c","original_commit_id":"2ce255813312f5f55483d6f4f0c85543c608b81c","user":{"login":"anttileppa","id":1730736,"node_id":"MDQ6VXNlcjE3MzA3MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/1730736?v=4","gravatar_id":"","url":"https://api.github.com/users/anttileppa","html_url":"https://github.com/anttileppa","followers_url":"https://api.github.com/users/anttileppa/followers","following_url":"https://api.github.com/users/anttileppa/following{/other_user}","gists_url":"https://api.github.com/users/anttileppa/gists{/gist_id}","starred_url":"https://api.github.com/users/anttileppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anttileppa/subscriptions","organizations_url":"https://api.github.com/users/anttileppa/orgs","repos_url":"https://api.github.com/users/anttileppa/repos","events_url":"https://api.github.com/users/anttileppa/events{/privacy}","received_events_url":"https://api.github.com/users/anttileppa/received_events","type":"User","site_admin":false},"body":"unused, double defined  index?","created_at":"2018-06-13T12:08:09Z","updated_at":"2018-06-13T12:10:18Z","html_url":"https://github.com/Metatavu/metaform-management/pull/6#discussion_r195056425","pull_request_url":"https://api.github.com/repos/Metatavu/metaform-management/pulls/6","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Metatavu/metaform-management/pulls/comments/195056425"},"html":{"href":"https://github.com/Metatavu/metaform-management/pull/6#discussion_r195056425"},"pull_request":{"href":"https://api.github.com/repos/Metatavu/metaform-management/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/Metatavu/metaform-management/pulls/6","id":194562733,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NTYyNzMz","html_url":"https://github.com/Metatavu/metaform-management/pull/6","diff_url":"https://github.com/Metatavu/metaform-management/pull/6.diff","patch_url":"https://github.com/Metatavu/metaform-management/pull/6.patch","issue_url":"https://api.github.com/repos/Metatavu/metaform-management/issues/6","number":6,"state":"open","locked":false,"title":"Feature #5 report improve","user":{"login":"VilleKoivukangas","id":20184324,"node_id":"MDQ6VXNlcjIwMTg0MzI0","avatar_url":"https://avatars1.githubusercontent.com/u/20184324?v=4","gravatar_id":"","url":"https://api.github.com/users/VilleKoivukangas","html_url":"https://github.com/VilleKoivukangas","followers_url":"https://api.github.com/users/VilleKoivukangas/followers","following_url":"https://api.github.com/users/VilleKoivukangas/following{/other_user}","gists_url":"https://api.github.com/users/VilleKoivukangas/gists{/gist_id}","starred_url":"https://api.github.com/users/VilleKoivukangas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VilleKoivukangas/subscriptions","organizations_url":"https://api.github.com/users/VilleKoivukangas/orgs","repos_url":"https://api.github.com/users/VilleKoivukangas/repos","events_url":"https://api.github.com/users/VilleKoivukangas/events{/privacy}","received_events_url":"https://api.github.com/users/VilleKoivukangas/received_events","type":"User","site_admin":false},"body":"resolves #5 ","created_at":"2018-06-13T12:01:53Z","updated_at":"2018-06-13T12:10:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a768c89bdef72ed023a41a34272d8013acf08035","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Metatavu/metaform-management/pulls/6/commits","review_comments_url":"https://api.github.com/repos/Metatavu/metaform-management/pulls/6/comments","review_comment_url":"https://api.github.com/repos/Metatavu/metaform-management/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Metatavu/metaform-management/issues/6/comments","statuses_url":"https://api.github.com/repos/Metatavu/metaform-management/statuses/2ce255813312f5f55483d6f4f0c85543c608b81c","head":{"label":"Metatavu:feature-#5-report-improve","ref":"feature-#5-report-improve","sha":"2ce255813312f5f55483d6f4f0c85543c608b81c","user":{"login":"Metatavu","id":20443466,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDQzNDY2","avatar_url":"https://avatars0.githubusercontent.com/u/20443466?v=4","gravatar_id":"","url":"https://api.github.com/users/Metatavu","html_url":"https://github.com/Metatavu","followers_url":"https://api.github.com/users/Metatavu/followers","following_url":"https://api.github.com/users/Metatavu/following{/other_user}","gists_url":"https://api.github.com/users/Metatavu/gists{/gist_id}","starred_url":"https://api.github.com/users/Metatavu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metatavu/subscriptions","organizations_url":"https://api.github.com/users/Metatavu/orgs","repos_url":"https://api.github.com/users/Metatavu/repos","events_url":"https://api.github.com/users/Metatavu/events{/privacy}","received_events_url":"https://api.github.com/users/Metatavu/received_events","type":"Organization","site_admin":false},"repo":{"id":135040610,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUwNDA2MTA=","name":"metaform-management","full_name":"Metatavu/metaform-management","owner":{"login":"Metatavu","id":20443466,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDQzNDY2","avatar_url":"https://avatars0.githubusercontent.com/u/20443466?v=4","gravatar_id":"","url":"https://api.github.com/users/Metatavu","html_url":"https://github.com/Metatavu","followers_url":"https://api.github.com/users/Metatavu/followers","following_url":"https://api.github.com/users/Metatavu/following{/other_user}","gists_url":"https://api.github.com/users/Metatavu/gists{/gist_id}","starred_url":"https://api.github.com/users/Metatavu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metatavu/subscriptions","organizations_url":"https://api.github.com/users/Metatavu/orgs","repos_url":"https://api.github.com/users/Metatavu/repos","events_url":"https://api.github.com/users/Metatavu/events{/privacy}","received_events_url":"https://api.github.com/users/Metatavu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metatavu/metaform-management","description":"Management service for the Metaform API","fork":false,"url":"https://api.github.com/repos/Metatavu/metaform-management","forks_url":"https://api.github.com/repos/Metatavu/metaform-management/forks","keys_url":"https://api.github.com/repos/Metatavu/metaform-management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metatavu/metaform-management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metatavu/metaform-management/teams","hooks_url":"https://api.github.com/repos/Metatavu/metaform-management/hooks","issue_events_url":"https://api.github.com/repos/Metatavu/metaform-management/issues/events{/number}","events_url":"https://api.github.com/repos/Metatavu/metaform-management/events","assignees_url":"https://api.github.com/repos/Metatavu/metaform-management/assignees{/user}","branches_url":"https://api.github.com/repos/Metatavu/metaform-management/branches{/branch}","tags_url":"https://api.github.com/repos/Metatavu/metaform-management/tags","blobs_url":"https://api.github.com/repos/Metatavu/metaform-management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metatavu/metaform-management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metatavu/metaform-management/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metatavu/metaform-management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metatavu/metaform-management/statuses/{sha}","languages_url":"https://api.github.com/repos/Metatavu/metaform-management/languages","stargazers_url":"https://api.github.com/repos/Metatavu/metaform-management/stargazers","contributors_url":"https://api.github.com/repos/Metatavu/metaform-management/contributors","subscribers_url":"https://api.github.com/repos/Metatavu/metaform-management/subscribers","subscription_url":"https://api.github.com/repos/Metatavu/metaform-management/subscription","commits_url":"https://api.github.com/repos/Metatavu/metaform-management/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metatavu/metaform-management/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metatavu/metaform-management/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metatavu/metaform-management/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metatavu/metaform-management/contents/{+path}","compare_url":"https://api.github.com/repos/Metatavu/metaform-management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metatavu/metaform-management/merges","archive_url":"https://api.github.com/repos/Metatavu/metaform-management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metatavu/metaform-management/downloads","issues_url":"https://api.github.com/repos/Metatavu/metaform-management/issues{/number}","pulls_url":"https://api.github.com/repos/Metatavu/metaform-management/pulls{/number}","milestones_url":"https://api.github.com/repos/Metatavu/metaform-management/milestones{/number}","notifications_url":"https://api.github.com/repos/Metatavu/metaform-management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metatavu/metaform-management/labels{/name}","releases_url":"https://api.github.com/repos/Metatavu/metaform-management/releases{/id}","deployments_url":"https://api.github.com/repos/Metatavu/metaform-management/deployments","created_at":"2018-05-27T11:35:27Z","updated_at":"2018-06-07T06:50:48Z","pushed_at":"2018-06-13T12:01:54Z","git_url":"git://github.com/Metatavu/metaform-management.git","ssh_url":"git@github.com:Metatavu/metaform-management.git","clone_url":"https://github.com/Metatavu/metaform-management.git","svn_url":"https://github.com/Metatavu/metaform-management","homepage":null,"size":218,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Metatavu:master","ref":"master","sha":"9ca13a6a9547a7e5eeeccc1bc8d515a68e582ff1","user":{"login":"Metatavu","id":20443466,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDQzNDY2","avatar_url":"https://avatars0.githubusercontent.com/u/20443466?v=4","gravatar_id":"","url":"https://api.github.com/users/Metatavu","html_url":"https://github.com/Metatavu","followers_url":"https://api.github.com/users/Metatavu/followers","following_url":"https://api.github.com/users/Metatavu/following{/other_user}","gists_url":"https://api.github.com/users/Metatavu/gists{/gist_id}","starred_url":"https://api.github.com/users/Metatavu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metatavu/subscriptions","organizations_url":"https://api.github.com/users/Metatavu/orgs","repos_url":"https://api.github.com/users/Metatavu/repos","events_url":"https://api.github.com/users/Metatavu/events{/privacy}","received_events_url":"https://api.github.com/users/Metatavu/received_events","type":"Organization","site_admin":false},"repo":{"id":135040610,"node_id":"MDEwOlJlcG9zaXRvcnkxMzUwNDA2MTA=","name":"metaform-management","full_name":"Metatavu/metaform-management","owner":{"login":"Metatavu","id":20443466,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNDQzNDY2","avatar_url":"https://avatars0.githubusercontent.com/u/20443466?v=4","gravatar_id":"","url":"https://api.github.com/users/Metatavu","html_url":"https://github.com/Metatavu","followers_url":"https://api.github.com/users/Metatavu/followers","following_url":"https://api.github.com/users/Metatavu/following{/other_user}","gists_url":"https://api.github.com/users/Metatavu/gists{/gist_id}","starred_url":"https://api.github.com/users/Metatavu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Metatavu/subscriptions","organizations_url":"https://api.github.com/users/Metatavu/orgs","repos_url":"https://api.github.com/users/Metatavu/repos","events_url":"https://api.github.com/users/Metatavu/events{/privacy}","received_events_url":"https://api.github.com/users/Metatavu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Metatavu/metaform-management","description":"Management service for the Metaform API","fork":false,"url":"https://api.github.com/repos/Metatavu/metaform-management","forks_url":"https://api.github.com/repos/Metatavu/metaform-management/forks","keys_url":"https://api.github.com/repos/Metatavu/metaform-management/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Metatavu/metaform-management/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Metatavu/metaform-management/teams","hooks_url":"https://api.github.com/repos/Metatavu/metaform-management/hooks","issue_events_url":"https://api.github.com/repos/Metatavu/metaform-management/issues/events{/number}","events_url":"https://api.github.com/repos/Metatavu/metaform-management/events","assignees_url":"https://api.github.com/repos/Metatavu/metaform-management/assignees{/user}","branches_url":"https://api.github.com/repos/Metatavu/metaform-management/branches{/branch}","tags_url":"https://api.github.com/repos/Metatavu/metaform-management/tags","blobs_url":"https://api.github.com/repos/Metatavu/metaform-management/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Metatavu/metaform-management/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Metatavu/metaform-management/git/refs{/sha}","trees_url":"https://api.github.com/repos/Metatavu/metaform-management/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Metatavu/metaform-management/statuses/{sha}","languages_url":"https://api.github.com/repos/Metatavu/metaform-management/languages","stargazers_url":"https://api.github.com/repos/Metatavu/metaform-management/stargazers","contributors_url":"https://api.github.com/repos/Metatavu/metaform-management/contributors","subscribers_url":"https://api.github.com/repos/Metatavu/metaform-management/subscribers","subscription_url":"https://api.github.com/repos/Metatavu/metaform-management/subscription","commits_url":"https://api.github.com/repos/Metatavu/metaform-management/commits{/sha}","git_commits_url":"https://api.github.com/repos/Metatavu/metaform-management/git/commits{/sha}","comments_url":"https://api.github.com/repos/Metatavu/metaform-management/comments{/number}","issue_comment_url":"https://api.github.com/repos/Metatavu/metaform-management/issues/comments{/number}","contents_url":"https://api.github.com/repos/Metatavu/metaform-management/contents/{+path}","compare_url":"https://api.github.com/repos/Metatavu/metaform-management/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Metatavu/metaform-management/merges","archive_url":"https://api.github.com/repos/Metatavu/metaform-management/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Metatavu/metaform-management/downloads","issues_url":"https://api.github.com/repos/Metatavu/metaform-management/issues{/number}","pulls_url":"https://api.github.com/repos/Metatavu/metaform-management/pulls{/number}","milestones_url":"https://api.github.com/repos/Metatavu/metaform-management/milestones{/number}","notifications_url":"https://api.github.com/repos/Metatavu/metaform-management/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Metatavu/metaform-management/labels{/name}","releases_url":"https://api.github.com/repos/Metatavu/metaform-management/releases{/id}","deployments_url":"https://api.github.com/repos/Metatavu/metaform-management/deployments","created_at":"2018-05-27T11:35:27Z","updated_at":"2018-06-07T06:50:48Z","pushed_at":"2018-06-13T12:01:54Z","git_url":"git://github.com/Metatavu/metaform-management.git","ssh_url":"git@github.com:Metatavu/metaform-management.git","clone_url":"https://github.com/Metatavu/metaform-management.git","svn_url":"https://github.com/Metatavu/metaform-management","homepage":null,"size":218,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":null,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Metatavu/metaform-management/pulls/6"},"html":{"href":"https://github.com/Metatavu/metaform-management/pull/6"},"issue":{"href":"https://api.github.com/repos/Metatavu/metaform-management/issues/6"},"comments":{"href":"https://api.github.com/repos/Metatavu/metaform-management/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/Metatavu/metaform-management/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/Metatavu/metaform-management/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Metatavu/metaform-management/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/Metatavu/metaform-management/statuses/2ce255813312f5f55483d6f4f0c85543c608b81c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"anttileppa"}}