Skip to content

Instantly share code, notes, and snippets.

@yorzi
Created January 6, 2013 13:05
Show Gist options
  • Save yorzi/4467012 to your computer and use it in GitHub Desktop.
Save yorzi/4467012 to your computer and use it in GitHub Desktop.
svg = $('svg').parent().html()
canvg('canvas', svg)
canvas = document.getElementById("canvas")
img_PNG = Canvas2Image.saveAsPNG(canvas, true)
$('.chart').html(img_PNG)
@hiteshsingla
Copy link

What if i have multiple charts or multiple svg elements on my page??
How to capture the specific chart??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment