Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

112
Visualizações
Google ComboChart : highlight effect on graphs

I have a google combochart with two graphs (bar chart and area chart). (see code below)

What I want to do is a "highlight effect on graphs", I mean how to make one graph or the other more transparent depending on the mouseover event.

In other words:

  • my mouse hovers the area chart -> the opacity of the bar chart decreases
  • my mouse hovers the bar chart -> the opacity of the aera chart decreases

I thought about something like google.visualization.events.addListener(chart, 'onmouseover', function (e){} but I didn't manage to implement it.

Hope to be clear enough, thanks for your help !

<html>

<head>
  <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
  <script type="text/javascript">
    google.charts.load('current', {
      'packages': ['corechart']
    });
    google.charts.setOnLoadCallback(drawVisualization);

    function drawVisualization() {
      // Some raw data (not necessarily accurate)
      var data = google.visualization.arrayToDataTable([
        ['Month', 'Bolivia', 'Average'],
        ['2004/05', 165, 614.6],
        ['2005/06', 135, 682],
        ['2006/07', 157, 623],
        ['2007/08', 139, 609.4],
        ['2008/09', 136, 569.6]
      ]);

      var options = {
        title: 'Monthly Coffee Production by Country',
        vAxis: {
          title: 'Cups'
        },
        hAxis: {
          title: 'Month'
        },
        seriesType: 'bars',
        series: {
          0: {
            targetAxisIndex: 0,
            type: 'area'
          },
          1: {
            targetAxisIndex: 1,
          },

        }
      };

      var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
      chart.draw(data, options);
    }
  </script>
</head>

<body>
  <div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>

</html>

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda