Skip to content

Instantly share code, notes, and snippets.

@derekblank
Created November 7, 2013 20:33
Show Gist options
  • Save derekblank/7361399 to your computer and use it in GitHub Desktop.
Save derekblank/7361399 to your computer and use it in GitHub Desktop.
var chartCanvas = function(name, size) {
var $canvas = $('#' + name + '-canvas');
$canvas.attr(size || {
width : '200',
height : '200'
});
return $canvas.get(0) && $canvas.get(0).getContext("2d");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment