In order for Chart.js to obey the custom size you need to setmaintainAspectRatioto false, example: <Bar data={data} width={100} height={50} options={{ maintainAspectRatio: false }} /> Chart instance Chart instance can be accessed by placing a ref to the element as: ...
ChartJS React图-2:如何在条形图中显示过去5年的发行日期时间线?不确定您要查找的结果,但以下代码将...
Can you please provide an example (repo, codesanbox, ...) with a reproduction of this issue? Alexander3 commented Oct 26, 2021 I have the same issue with chart.js@3.5.1 and react-chartjs-2@3.0.5. Seems like setting same labels on multiple datasets in bar chart causes the problem. ...
{this.options} /> Bar Chart <Bar data={this.data} options={this.options} /> Area Chart <Line data={this.areaData} options={this.areaOptions} />