Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fullstackto/9259992 to your computer and use it in GitHub Desktop.
Save fullstackto/9259992 to your computer and use it in GitHub Desktop.
Responsive canvas redrawing of Chart.js using jQuery
var width = $('canvas').parent().width();
$('canvas').attr("width",width);
new Chart(ctx).Line(data,options);
window.onresize = function(event){
var width = $('canvas').parent().width();
$('canvas').attr("width",width);
new Chart(ctx).Line(data,options);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment