Skip to content

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.

3 participants