Closed switmac closed 6 years ago
Set the width on your graph container, then set the width of your canvas element to 100% using css width: 100% !important
.
Set these global chart options to:
responsive: true,
maintainAspectRatio: false,
I've done it with this code. although I've use the chart.js for showing on WebView
on my application.
<canvas style="width: 100% !important;height: auto !important;" id="canvas">
Hello,
Is there anyway for me to set the canvass width to 100% to make it responsive? Or how can I set the global property to responsive using ecma6 in React.
Here is my sample usage of the API.