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

177
Views
Las opciones de Chart.js no funcionan en React.js

Estoy tratando de colocar la leyenda a la derecha de mi gráfico, pero las opciones no funcionan...

 import { Chart } from 'react-chartjs-2'; import 'chart.js/auto'; const data = { labels: [ 'Red', 'Green', 'Yellow' ], datasets: [{ data: [700, 50, 100], backgroundColor: [ '#FF6384', '#36A2EB', '#FFCE56' ], hoverBackgroundColor: [ '#FF6384', '#36A2EB', '#FFCE56' ], }] }; const TestimonialSection = () => { return( <div id="chart"> <Chart type="doughnut" data={data} options={{legend: {position: 'right'}}}/> </div> ) } export default TestimonialSection

Acabo de escribir este archivo y aparece el gráfico, lo único que no funciona son las opciones. También verifiqué la dependencia y todo se ve bien

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

0

para la última versión, esta es la estructura del objeto que debe hacer.

 options = { plugins: { legend: { display: false, position: right, ... }, } }
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!