getRelativePosition takes two arguments (#8336)

This commit is contained in:
Evert Timberg 2021-01-25 15:59:19 -05:00 committed by GitHub
parent 0732aef4be
commit 8cca4fe5b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ const chart = new Chart(ctx, {
data: data,
options: {
onClick: (e) => {
const canvasPosition = Chart.helpers.getRelativePosition(e);
const canvasPosition = Chart.helpers.getRelativePosition(e, chart);
// Substitute the appropriate scale IDs
const dataX = chart.scales.x.getValueForPixel(canvasPosition.x);