mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
getRelativePosition takes two arguments (#8336)
This commit is contained in:
parent
0732aef4be
commit
8cca4fe5b9
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user