Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix getRelativePosition type definition #9610

Merged
merged 2 commits into from Sep 6, 2021
Merged

Conversation

aha-oretama
Copy link
Contributor

I referred to this official document.
https://www.chartjs.org/docs/latest/configuration/interactions.html#converting-events-to-data-values

The argument of onClick function is defined here.

onClick(event: ChartEvent, elements: ActiveElement[], chart: Chart): void;

The getRelativePosition supports both types in JS code. The following getCanvasPosition function is called in getRelativePosition.

const e = evt.native || evt;

Then, the first argument of getRelativePosition should accept ChartEvent too.

@etimberg etimberg added the type: types Typescript type changes label Sep 2, 2021
@etimberg etimberg added this to the Version 3.6.0 milestone Sep 2, 2021
@etimberg
Copy link
Member

etimberg commented Sep 2, 2021

This is failing because ChartEvent is not defined. Once the CI passes, this looks good to me

@etimberg etimberg merged commit 61e3eca into chartjs:master Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: types Typescript type changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants