mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-15 04:36:51 +01:00
getRelativePosition takes two arguments (#8336)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user