Google chart redraw/scale on window resize

前端 未结 9 1322
甜味超标
甜味超标 2020-12-07 19:50

How do I redraw/rescale a google linechart on window resize?

9条回答
  •  清歌不尽
    2020-12-07 20:20

    I've been stuck on the same thing for days and I found out that adding an event works best.

    window.addEventListener("resize", drawChart);
    

    Just add this line after declaring your function and it will work fine.

    Replace drawChart with the name of your function.

提交回复
热议问题