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

221
Views
cómo establecer la misma altura de barra en chartJS de barras apiladas aunque los números no sean iguales

https://jsfiddle.net/jsfLrc/krvodyx4/3/

Estoy usando chart.js para crear barras apiladas. Ahora la altura de cada barra depende de sus números totales. Quiero configurar todas las barras apiladas de la misma altura aunque los números totales de cada barra no sean iguales.

¿Hay alguna forma de configurarlo así? foto de resultado

a continuación está el código que hice ahora

 var ctx = document.getElementById('myChart').getContext('2d'); var myChart = new Chart(ctx, { type: 'horizontalBar', data: { labels: ['F4A', 'F4B', 'F4C'], datasets: [{ label: 'M', data: [47.62, 50.00, 100], backgroundColor: [ '#758C46', '#758C46', '#758C46', ], borderColor: [ '#758C46', '#758C46', '#758C46', ], borderWidth: 1 },{ label: 'F', data: [52.38, 50.00, 0], backgroundColor: [ '#6BBCC0', '#6BBCC0', '#6BBCC0', ], borderColor: [ '#6BBCC0', '#6BBCC0', '#6BBCC0', ], borderWidth: 1 }] }, options: { indexAxis: 'y', scales: { xAxes: [{ stacked: true, min: 0, max: 100, callback: function(value) { return value + "%" } }], yAxes: [{ ticks: { beginAtZero: true, max:100 }, stacked: true }] }, legend: { display: true, }, title: { display: true, fontColor: 'black', fontSize: '20' } } });
about 4 years ago · Juan Pablo Isaza
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!