jQuery Sparkline as PNG

HTML

<script src="http://omnipotent.net/jquery.sparkline/2.1/jquery.sparkline.js"></script>
<p>
Sparkline appears here: <span id="sparkline">&nbsp;</span>
</p>
<button id="pngit">Click to open as png</button>

JavaScript

// jsfiddle configured to load jQuery Sparkline 2.1
// http://omnipotent.net/jquery.sparkline/
// Values to render
var values = [5, 4, 5, -2, 0, 3];

// Draw a sparkline for the #sparkline element
$('#sparkline').sparkline(values, {
    type: "line",
    tooltipSuffix: " widgets"
});

$('#pngit').click(function() {
    window.open($('#sparkline canvas')[0].toDataURL('image/png'));
});