jquery.sparkline
jquery.sparkline copied to clipboard
Redraw on window resize
When I load my page containing a sparkline container inside of a fluid div, and I resize the window to show a larger graph, the line chart becomes very low resolution. Is there a way to make it responsive or to redraw it with a window resize?
function sparkline() { $("#yourspark-chart").sparkline([209, 210, 209, 210, 210, 211, 212, 210], { type: 'line', width: '96%', height: '30' }); } sparkline(); You may call the function on window resize $( window ).resize(function() { sparkline(); }); It works fine for me hope Will help you @iadj
@sivajisanapala it isn't working for me.
UPDATE Sorry, I went too fast, it's working but it's slow.
UPDATE 2 Using CSS is working like a charm:
.sparkline
canvas
width: 100%