Chart.js canvas resize

前端 未结 13 1181
北海茫月
北海茫月 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-11-30 23:52

    I had a lot of problems with that, because after all of that my line graphic looked terrible when mouse hovering and I found a simpler way to do it, hope it will help :)

    Use these Chart.js options:

    // Boolean - whether or not the chart should be responsive and resize when the browser does.
    
    responsive: true,
    
    // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
    
    maintainAspectRatio: false,
    

提交回复
热议问题