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

248
Views
No se puede encontrar el archivo: 'Chart.js' no coincide con el nombre correspondiente en el disco: '.\node_modules\chart.js\dist\chart.js'

Estoy tratando de implementar un gráfico de barras. ¿Qué estoy haciendo mal aquí?

aquí también recibo un error que dice usar mecanografiado

formatter: (value: number) => value + " %", pero solo uso el formato .js

 import { Chart } from "chart.js"; import { Bar } from "react-chartjs-2"; import ChartjsPluginStacked100 from "chartjs-plugin-stacked100"; import "chart.js/auto"; import ChartDataLabels from "chartjs-plugin-datalabels"; Chart.register(ChartDataLabels); const ExampleChart = () => ( <Bar data={{ labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", backgroundColor: "#EC932F", borderColor: "rgba(255,99,132,1)", borderWidth: 1, hoverBackgroundColor: "rgba(255,99,132,0.4)", hoverBorderColor: "rgba(255,99,132,1)", data: [65, 59, 80, 81, 56, 55, 100], borderRadius: 50, // Make Rectangle rounded }, ], }} options={{ indexAxis: "y", // Horizontal bar plugins: { datalabels: { formatter: (value: number) => value + " %", // Add the percentage after the value align: "end", anchor: "end", clip: true, // Hide label if outside of the chart }, }, scales: { x: { grid: { display: false, // Hide x grid }, }, y: { grid: { display: false, // Hide y grid }, }, }, }} /> ); export default function bar() { return ( <div className=""> <ExampleChart /> </div> ); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Parece que está usando mecanografías en el archivo .js .

Eliminar Typings de su función de formateador

 formatter: (value) => value + " %", // Add the percentage after the value

Pila de trabajoBlitz

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!