Chart.js canvas resize

前端 未结 13 1182
北海茫月
北海茫月 2020-11-30 23:39

In (Android WebView HTML5 canvas error) i posted a question regarding plotting graphs using Graph.js library. The problem i have now is that if i call the function to plot t

13条回答
  •  悲&欢浪女
    2020-12-01 00:08

    In IOS and Android the browser hides the toolbar when you are scrolling, thereby changing the size of the window which inturn lead chartjs to resize the graph. The solution is to maintain the aspect ratio.

    var options = { 
        responsive: true,
        maintainAspectRatio: true
    }
    

    This should solve your problem.

提交回复
热议问题