question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add getElementsAtEventForMode to @types/chart.js

See original GitHub issue

Hello,

It’s missing getElementsAtEventForMode from chart.js types, could that be added?

This works for me: getElementsAtEventForMode: (e: any, mode: Chart.InteractionMode, options: any, useFinalPosition: boolean) => Chart.ChartPoint;

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
LeeLenaleeecommented, Sep 2, 2021

@types/chart.js is not maintained by chart.js afaik, also those are the typings for v2. In v2 there was no getElementsAtEventForMode. Since chart.js v3 chart.js comes with build in typing and getElementsAtEventForMode is defined in the typings here: https://github.com/chartjs/Chart.js/blob/8d68b119bcb95af182cc69d42acad8490af53d3e/types/index.esm.d.ts#L502

0reactions
RiccardoCafacommented, Sep 3, 2021

Thanks for answering @kurkle I know this is not the appropriate place to solve this kind of problem, so I made a SO question

Already tried to remove @types/chart.js And the errors are that my class doesn’t recognize any method, class, type from chartjs

Read more comments on GitHub >

github_iconTop Results From Across the Web

API | Chart.js
Calling getElementsAtEventForMode(e, mode, options, useFinalPosition) on your Chart instance passing an event and a mode will return the ...
Read more >
Use cases of getElementsAtEventForMode are not documented
Can you please add the use case documentation for the getElementsAtEventForMode. Digging through version history is slightly not obvious.
Read more >
getElementsAtEventForMode() of chartJS 3.0 - Stack Overflow
My question is getElementsAtEventForMode() is not working as expected When line data is null. // Same result. const elements = myChart.
Read more >
Handle chart click event - Javascript Chart.js - Java2s.com
<html lang="en"> <head> <title>chart.js barcode value</title> </head> <body ... getElementsAtEventForMode(evt, 'point', myChart.options); var firstPoint ...
Read more >
@types/chartjs - npm
TypeScript definitions for Chart.js. Latest version: 0.0.31, last published: 5 ... Author message: '@types/chartjs' is now '@types/chart.js' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found