Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

326
Vistas
Google charts, I can't change bars color

I need to change the colors of the bars to red and blue. Red for the limit, blue for mining. An array with data is connected to the script. I was able to customize everything except the color

function drawChart() {
  var data = google.visualization.arrayToDataTable(regiondata);
  
  var options = {
    chart: {
      title: 'Реализация по годам',
      subtitle: 'График реализации и добычи',
      width: 100,
    },

    bars: 'vertical',
    vAxis: {format: 'decimal'},
    height: 280,
    width: 610,
    colors: ['red', 'blue'],
    backgroundColor: '#F9F6F0',
    
  };

  var chart = new google.charts.Bar(document.getElementById('content-graf'));

  chart.draw(data, google.charts.Bar.convertOptions(options));
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

According to the documentation, you can do it this way :

var data = google.visualization.arrayToDataTable([
  ['Element', 'Density', { role: 'style' }],
  ['Copper', 8.94, '#b87333'],            // RGB value
  ['Silver', 10.49, 'silver'],            // English color name
  ['Gold', 19.30, 'gold'],
  ['Platinum', 21.45, 'color: #e5e4e2' ], // CSS-style declaration
]);
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda