Hacker News new | ask | show | jobs
by ssrubin 4842 days ago
But on the other hand, SVG is infinitely more useful if you want to extract chart data from the page.
2 comments

How is that more useful than a link to the source data in a format appropriate to the data?
It's not, but how often do you see a news source link to the raw data?
or display the same chart somewhere other than a web page, eg: a PDF or IOS app.
well, it's pretty easy to go from canvas to png, which I think is more portable than svg + css
How do you do that? I right-clicked on some graph, but there is not "Save Image As" option in Chrome
On the docs page, in Chrome, hit ctrl+shift+J (option+cmd+J on OSX) to open the console, and paste this in:

$('canvas').click(function() { window.open( this.toDataURL("image/png") , 'Serialized Canvas' , 'height=' + this.height + 'width=' + this.width ); });

This will popup a png version of a canvas graph if you click it.

It's a canvas API function. So the author has to add this function (which is trivial).