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

483
Views
Chart.js: ¿Cómo establecer la altura mínima del gráfico pero aún así mantener la relación de aspecto?

¿Cómo puedo establecer una relación de aspecto fija en el gráfico pero también establecer una altura mínima para que se comporte como se muestra a continuación?

ingrese la descripción de la imagen aquí

He intentado usar react-chartjs-2 :

 <div style={{ minHeight: 300, paddingTop: "33.33333%", }} > <Bar style={{ width: "100%", height: "100%" }} //data={...} options={{ maintainAspectRatio: false, }} /> </div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Lo resolvió agregando un div intermedio entre el contenedor y el gráfico:

 <div style={{ minHeight: 300, paddingTop: "33.33333%", position: "relative", }} > <div style={{ position: "absolute", inset: 0, }} > <Bar style={{ width: "100%", height: "100%" }} //data={...} options={{ maintainAspectRatio: false, }} /> </div> </div>
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!