{"action":"created","issue":{"url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/73","labels_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/73/comments","events_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/73/events","html_url":"https://github.com/jtblin/angular-chart.js/issues/73","id":59489761,"number":73,"title":".toBase64Image()","user":{"login":"TWKDreamState","id":8638987,"avatar_url":"https://avatars.githubusercontent.com/u/8638987?v=3","gravatar_id":"","url":"https://api.github.com/users/TWKDreamState","html_url":"https://github.com/TWKDreamState","followers_url":"https://api.github.com/users/TWKDreamState/followers","following_url":"https://api.github.com/users/TWKDreamState/following{/other_user}","gists_url":"https://api.github.com/users/TWKDreamState/gists{/gist_id}","starred_url":"https://api.github.com/users/TWKDreamState/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TWKDreamState/subscriptions","organizations_url":"https://api.github.com/users/TWKDreamState/orgs","repos_url":"https://api.github.com/users/TWKDreamState/repos","events_url":"https://api.github.com/users/TWKDreamState/events{/privacy}","received_events_url":"https://api.github.com/users/TWKDreamState/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jtblin/angular-chart.js/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-02T14:44:04Z","updated_at":"2015-03-08T10:45:11Z","closed_at":"2015-03-08T10:45:11Z","body":"Hi,\r\n\r\nWhat would be the best way to use the .toBase64Image() option from chart.js (http://www.chartjs.org/docs/ - prototype method) in angular-chart.js?\r\n\r\nI'd like to be able to click a button and produce a PDF using jsPDF, which accepts a base64 image. Therefore, I'd need to do this in the controller once the charts have completed rendering. Is there a way to access this in the controller (given that the chart is a directive? - I'm fairly new to angular).\r\n\r\nMany thanks!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/comments/77743020","html_url":"https://github.com/jtblin/angular-chart.js/issues/73#issuecomment-77743020","issue_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/73","id":77743020,"user":{"login":"jtblin","id":1388974,"avatar_url":"https://avatars.githubusercontent.com/u/1388974?v=3","gravatar_id":"","url":"https://api.github.com/users/jtblin","html_url":"https://github.com/jtblin","followers_url":"https://api.github.com/users/jtblin/followers","following_url":"https://api.github.com/users/jtblin/following{/other_user}","gists_url":"https://api.github.com/users/jtblin/gists{/gist_id}","starred_url":"https://api.github.com/users/jtblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtblin/subscriptions","organizations_url":"https://api.github.com/users/jtblin/orgs","repos_url":"https://api.github.com/users/jtblin/repos","events_url":"https://api.github.com/users/jtblin/events{/privacy}","received_events_url":"https://api.github.com/users/jtblin/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T10:45:11Z","updated_at":"2015-03-08T10:45:11Z","body":"`chart.js toBase64Image()` is just a wrapper around ` canvas.toDataURL()` so that should be exactly the same. See https://github.com/nnnick/Chart.js/blob/019e985c8f468bf0700e5f7c4ff9b5268651e787/Chart.js#L1046\r\n\r\nThere are examples to do that [with jspdf on SO](http://stackoverflow.com/questions/23681325/convert-canvas-to-pdf-using-pdf-js)\r\n\r\nIf you want to do that from server side, you can have a look at the integration tests in this repo. I use phantomjs to take screenshot and test image differences."}}