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

114
Views
No se pueden configurar varios colores para el carácter de la barra de Google

Tengo el siguiente código donde puedo cargar el gráfico desde la base de datos, pero estoy tratando de aplicar varios colores que no funcionan.

 function drawStatuChart() { show('loading3', true); var data = JSON.stringify({ 'GraphId': 5, 'startDt': $("#from-date").val(), 'endDt': $("#to-date").val() }); $.ajax({ type: "POST", url: url, data: data, contentType: "application/json; charset=utf-8", dataType: "json", success: function (r) { var data = new google.visualization.DataTable(); var cols = r.splice(0, 1); cols[0].forEach(function (col, index) { if (index === 0) { data.addColumn('string', col); } else { data.addColumn('number', col); } }); if (r.length > 0) { data.addRows(r); } else { data.addRow(['', null]); } show('loading3', false); var view = new google.visualization.DataView(data); view.setColumns([0, 1, { calc: "stringify", sourceColumn: 1, type: "string", role: "annotation", } ]); var options = { width: '350', height: '300', 'overflow': 'hidden', bar: { groupWidth: "65%" }, legend: { position: "none" }, colors: ['#f8aa00', '#00778d'], fontName: 'Montserrat', chartArea: { left: "17%", top: "2%", height: "250", width: "250" } }; var chart = new google.visualization.BarChart($("#status")[0]); chart.draw(view, options); }, failure: function (r) { alert(rd); }, error: function (r) { alert(rd); } });

}

Obtengo los siguientes datos de db, pero de alguna manera no puedo aplicar diferentes colores

ingrese la descripción de la imagen aquí

Mostrando solo un color

ingrese la descripción de la imagen aquí

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!