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

121
Visualizações
How to write a click function on the point plotted using angular-google-charts-npm

I want to add a click on the plotted point of where, what, how and when. Like I want the 'Where' , 'What', 'How' and 'When' points to act as a click button . I am using angular-google-charts - npm.

angular-google-chart drawChart

My Code is -

private drawChart(){

    let data = this.gLib.visualization.arrayToDataTable([
          ['Aspect', 'Splash'],
          ['Where',  1    ],
          ['What',   2    ],
          ['How',    3    ],
          ['When',   4    ]
    ]);
    var options = {'title':'How Much Pizza I Ate Last Night',
    'width':400,
    'height':300};


    var chart:any = new this.gLib.visualization.LineChart(document.getElementById('divLineChart'));
    google.visualization.events.addListener(chart, 'select', this.selectHandler);
    chart.draw(data, options);
    chart.draw(data);

    
  }
  selectHandler() {
    var chart:any = new this.gLib.visualization.LineChart(document.getElementById('divLineChart'));
    let data = this.gLib.visualization.arrayToDataTable([
        ['Aspect', 'Splash'],
        ['Where',   1    ],
        ['What',    2    ],
        ['How',     3    ],
        ['When',    4    ]
  ]);
  
    var selectedItem = chart.getSelection()[1];
    console.log("selectedItem = ", selectedItem)
   
    var value = data.getValue(selectedItem.row, 1);
    console.log("value = ", value);
    alert('The user selected ' + value);
  }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Looking into the documentation of the package there seem to be a couple of events that may help you with that. Namely select seem to be the most appropriate.

about 4 years ago · Juan Pablo Isaza Relatório
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