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

504
Views
reaccionar gráfico js, el título no se muestra

Estoy usando el gráfico de reacción js para mostrar una dona en mi componente.

 "chart.js": "^3.7.1", "react-chartjs-2": "^4.1.0",

No puedo mostrar el título:

 const data = { labels: ["Score", "Total"], datasets: [ { label: "Indice d'impact global de la transaction", data: [3.7, 5], backgroundColor: ["rgba(54, 162, 235, 0.2)", "rgba(128,128,128,0.2)"], borderColor: ["rgba(54, 162, 235, 1", "rgba(128,128,128,1)"], borderWidth: 1, lineTension: 0.5, }, ], }; <Doughnut options={{ plugins: { title: { display: true, text: "Indice d'impact global de la transaction", align: "center", padding: { top: 10, bottom: 30, }, }, legend: { display: true, position: "top", }, scales: { y: { beginAtZero: true, }, }, }, }} data={data} />

¿Cómo puedo mostrar correctamente el título?

ingrese la descripción de la imagen aquí

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

0

Esto se debe a que está utilizando el método de sacudir árboles y no está importando ni registrando el Title .

Para solucionarlo, importe y registre todos los componentes que está utilizando, la lista de todos los componentes se puede encontrar aquí de la siguiente manera:

 import {Chart, Title} from 'chart.js'; Chart.register(Title);

O use la importación automática para permitir que chart.js registre todo por usted:

 import 'chart.js/auto'
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!