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
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 answers
Answer question

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 Report
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!