score:6

Accepted answer

in my case, setting maintainaspectratio:false along with supplying height/width on div

<div style={{height:'100px',width:'200px'}}>
<horizontalbar data={data} options={chartoptions}/>
</div>

helped in restricting the canvas's scalability.

relevant source: https://www.chartjs.org/docs/latest/general/responsive.html#important-note

score:2

try setting responsive: false in your options object. that should according to the documentation make so that the canvas doesn't resize (https://www.chartjs.org/docs/latest/general/responsive.html#configuration-options)


Related Query

More Query from same tag