{"action":"created","issue":{"url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/issues/21","repository_url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs","labels_url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/issues/21/comments","events_url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/issues/21/events","html_url":"https://github.com/moberwasserlechner/vaadin-chartjs/issues/21","id":175978739,"number":21,"title":"Chart image download","user":{"login":"moberwasserlechner","id":1049938,"avatar_url":"https://avatars.githubusercontent.com/u/1049938?v=3","gravatar_id":"","url":"https://api.github.com/users/moberwasserlechner","html_url":"https://github.com/moberwasserlechner","followers_url":"https://api.github.com/users/moberwasserlechner/followers","following_url":"https://api.github.com/users/moberwasserlechner/following{/other_user}","gists_url":"https://api.github.com/users/moberwasserlechner/gists{/gist_id}","starred_url":"https://api.github.com/users/moberwasserlechner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moberwasserlechner/subscriptions","organizations_url":"https://api.github.com/users/moberwasserlechner/orgs","repos_url":"https://api.github.com/users/moberwasserlechner/repos","events_url":"https://api.github.com/users/moberwasserlechner/events{/privacy}","received_events_url":"https://api.github.com/users/moberwasserlechner/received_events","type":"User","site_admin":false},"labels":[{"id":310987937,"url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":487971930,"url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/labels/in%20progress","name":"in progress","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"moberwasserlechner","id":1049938,"avatar_url":"https://avatars.githubusercontent.com/u/1049938?v=3","gravatar_id":"","url":"https://api.github.com/users/moberwasserlechner","html_url":"https://github.com/moberwasserlechner","followers_url":"https://api.github.com/users/moberwasserlechner/followers","following_url":"https://api.github.com/users/moberwasserlechner/following{/other_user}","gists_url":"https://api.github.com/users/moberwasserlechner/gists{/gist_id}","starred_url":"https://api.github.com/users/moberwasserlechner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moberwasserlechner/subscriptions","organizations_url":"https://api.github.com/users/moberwasserlechner/orgs","repos_url":"https://api.github.com/users/moberwasserlechner/repos","events_url":"https://api.github.com/users/moberwasserlechner/events{/privacy}","received_events_url":"https://api.github.com/users/moberwasserlechner/received_events","type":"User","site_admin":false},"assignees":[{"login":"moberwasserlechner","id":1049938,"avatar_url":"https://avatars.githubusercontent.com/u/1049938?v=3","gravatar_id":"","url":"https://api.github.com/users/moberwasserlechner","html_url":"https://github.com/moberwasserlechner","followers_url":"https://api.github.com/users/moberwasserlechner/followers","following_url":"https://api.github.com/users/moberwasserlechner/following{/other_user}","gists_url":"https://api.github.com/users/moberwasserlechner/gists{/gist_id}","starred_url":"https://api.github.com/users/moberwasserlechner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moberwasserlechner/subscriptions","organizations_url":"https://api.github.com/users/moberwasserlechner/orgs","repos_url":"https://api.github.com/users/moberwasserlechner/repos","events_url":"https://api.github.com/users/moberwasserlechner/events{/privacy}","received_events_url":"https://api.github.com/users/moberwasserlechner/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/milestones/4","html_url":"https://github.com/moberwasserlechner/vaadin-chartjs/milestones/0.4.0","labels_url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/milestones/4/labels","id":2027057,"number":4,"title":"0.4.0","description":"","creator":{"login":"moberwasserlechner","id":1049938,"avatar_url":"https://avatars.githubusercontent.com/u/1049938?v=3","gravatar_id":"","url":"https://api.github.com/users/moberwasserlechner","html_url":"https://github.com/moberwasserlechner","followers_url":"https://api.github.com/users/moberwasserlechner/followers","following_url":"https://api.github.com/users/moberwasserlechner/following{/other_user}","gists_url":"https://api.github.com/users/moberwasserlechner/gists{/gist_id}","starred_url":"https://api.github.com/users/moberwasserlechner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moberwasserlechner/subscriptions","organizations_url":"https://api.github.com/users/moberwasserlechner/orgs","repos_url":"https://api.github.com/users/moberwasserlechner/repos","events_url":"https://api.github.com/users/moberwasserlechner/events{/privacy}","received_events_url":"https://api.github.com/users/moberwasserlechner/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2016-09-25T17:16:07Z","updated_at":"2016-11-17T11:25:49Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-09-09T10:33:36Z","updated_at":"2016-11-24T13:09:47Z","closed_at":null,"body":"A user wants to download the current chart by clicking a button (vaadin button).\n\nIt looks like I have to call a js function on the connector using `com.vaadin.ui.AbstractJavaScriptComponent.callFunction(String, Object...)` and then call the server with a function registered by `com.vaadin.ui.AbstractJavaScriptComponent.addFunction(String, JavaScriptFunction)`\n\nI havenot found a method, which can retrieve the return value of a javascript function.\n\nResources:\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL\nhttps://github.com/chartjs/Chart.js/search?utf8=%E2%9C%93&q=toBase64Image\n\n```\n    this.getImageDataUrl= function() {\n         // call on function registered by server side component\n         self.sendImageDataUrl(chartjs.toBase64Image());\n    }\n```\n"},"comment":{"url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/issues/comments/262772917","html_url":"https://github.com/moberwasserlechner/vaadin-chartjs/issues/21#issuecomment-262772917","issue_url":"https://api.github.com/repos/moberwasserlechner/vaadin-chartjs/issues/21","id":262772917,"user":{"login":"dyorgio","id":1438251,"avatar_url":"https://avatars.githubusercontent.com/u/1438251?v=3","gravatar_id":"","url":"https://api.github.com/users/dyorgio","html_url":"https://github.com/dyorgio","followers_url":"https://api.github.com/users/dyorgio/followers","following_url":"https://api.github.com/users/dyorgio/following{/other_user}","gists_url":"https://api.github.com/users/dyorgio/gists{/gist_id}","starred_url":"https://api.github.com/users/dyorgio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dyorgio/subscriptions","organizations_url":"https://api.github.com/users/dyorgio/orgs","repos_url":"https://api.github.com/users/dyorgio/repos","events_url":"https://api.github.com/users/dyorgio/events{/privacy}","received_events_url":"https://api.github.com/users/dyorgio/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T13:09:46Z","updated_at":"2016-11-24T13:09:46Z","body":"Take care with animations: \r\n\r\nhttp://stackoverflow.com/questions/20206038/convert-charts-js-canvas-chart-to-image-using-todataurl-results-in-blank-imag\r\n\r\nGood approach ask JS component for Image URL, maybe some facilities methods can help, like:\r\n```java\r\n// Create a default button with action listener to download image.\r\nchart.createDownloadButton();\r\n// and/or\r\n// Include action listener to download image in an existent Button\r\nchart.configureDownloadButton(Button b);\r\n```\r\n"}}
{"actor":{"display_login":"dyorgio"}}