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

110
Views
¿Cómo cambio el color de la etiqueta? Gráfico.js

Estoy implementando un sitio web en django y en él tengo una página de panel. Tengo una gráfica que muestra la facturación de los meses pero no puedo cambiar el color que está marcado en la foto de abajo.

Gráfico de barras js

 $(function () { var $populationChart = $("#faturamento-mes"); $.ajax({ url: $populationChart.data("url"), success: function (data) { const backgroundcolor = [] for(i=0; i < data.data.length; i++){ if (data.data[i] < 6500){backgroundcolor.push('red')} if (data.data[i] >=6500){backgroundcolor.push('green')} } var ctx = $populationChart[0].getContext("2d"); new Chart(ctx, { type: 'bar', data: { labels: data.labels, datasets: [{ label: 'Faturamento', backgroundColor: backgroundcolor, data: data.data }] }, options: { responsive: true, legend: { position: 'top', }, title: { display: true, text: 'Faturamento por mês' } } }); } }); });
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!