'yAxes not re-render new data in Chart.js with React.js
Hi I try using the Line
chart in my project but get an error you can see it in the image below
package.json
"dependencies": {
"chart.js": "^3.7.1",
"react": "^17.0.2",
"react-chartjs-2": "^4.1.0",
"react-dom": "^17.0.2",
},
Chart code
const data = {
labels: coinTimeStamp,
datasets: [
{
label: 'Price in USD.',
data: coinPrice,
fill: false,
backgroundColor: '#0071bd',
borderColor: '#0071bd'
}
]
}
const options = {
scales: {
yAxes: [
{
ticks: {
beginAtZero: true
}
}
]
}
}
<Line data={data} options={options} />
and I get these two errors in the browser console
and thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|