jquery.sparkline icon indicating copy to clipboard operation
jquery.sparkline copied to clipboard

Redraw on window resize

Open iadj opened this issue 8 years ago • 2 comments

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?

iadj avatar Apr 27 '16 15:04 iadj

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 avatar Nov 09 '16 10:11 sivajisanapala

@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%

zedtux avatar May 30 '17 06:05 zedtux