Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
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

enter image description here

and thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

add the following to the import section

import { Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, } from 'chart.js';

ChartJS.register( CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend );

this will fix the issue

and this---

for Invalid scale config. for scale: yAxes, I removed the first array, I think it was and left it like this: const options = { scales: { y: { ticks: { beginAtZero: true, }, }, }, };

https://github.com/adrianhajdin/project_cryptoverse/issues/26

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!