bernii / gauge.js

100% native and cool looking JavaScript gauge
MIT License
1.42k stars 391 forks source link

How to accommodate responsive designs and screen rotation/resizing? #241

Open ryangriggs opened 3 years ago

ryangriggs commented 3 years ago

I'm trying to implement gauges in a responsive design that should support tablets/phones in landscape/portrait view. However, when I change the orientation, the gauge appears pixelated due to using the previous canvas size. How can I force the gauge to redraw to the new canvas size? I set the canvas height and width to "auto" and also called the render() function on resize, but it doesn't seem to do anything.

Thanks

AntonKremer commented 2 years ago

Any solution? I would be interested in a solution as well. Due to a responsive design, I would like to change the size of the canvas & and looking for a "force update" solution (everything is redrawn).

Best regards