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

148
Views
error de consola al usar getElementsAtEventForMode

Estoy tratando de llamar a la función getElementsAtEventForMode() en mi gráfico de anillos chart.js, pero sigo recibiendo este mensaje de error en la consola: chart.getElementsAtEventsForMode is not a function .

 // Pass the canvas ID let myChart = Chart.getChart('myChart'); //updating chart with new values each time a value is selected if (myChart) { myChart.data.labels = legend; myChart.data.datasets[0].data = stats; myChart.config.options.plugins.title.text = "Top 5 causes of death in " + country; myChart.update(); } else { new Chart('myChart', config); } //detecting click on doughnut sections for modal this.clickHandler = function (onclick) { const points = myChart.getElementsAtEventForMode(onclick, 'nearest', { intersect: true }, true); if (points[0]) { modal.classList.toggle('hide'); } } addEventListener("click", this.clickHandler);
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

No puede usar la instancia de gráfico global, debe usar su instancia de gráfico para llamar a la función de esta manera:

 const chartInstance = Chart.getChart(canvasId); const points = chartInstance.getElementsAtEventForMode("click", 'nearest', { intersect: true }, true);
about 4 years ago · Juan Pablo Isaza Report

0

En Chartjs, tiene getElementsAtEventForMode no eventsForMode ... use

 Chart.getElementsAtEventForMode

en vez de

 Chart.getElementsAtEventsForMode
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!