]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
getRelativePosition takes two arguments (#8336)
authorEvert Timberg <evert.timberg+github@gmail.com>
Mon, 25 Jan 2021 20:59:19 +0000 (15:59 -0500)
committerGitHub <noreply@github.com>
Mon, 25 Jan 2021 20:59:19 +0000 (22:59 +0200)
docs/docs/general/interactions/events.md

index cfa14494bfaeeadf41dfb8176f01795ae8a0c3c8..5039460a393a4bf49081dde012d58c4cac99ddf3 100644 (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);