Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda