Hi I have an area chart with multiple values of X (year) and Y (price). As I already found, there is an easy way to get X, Y matters for the chart, when the user clicks on one of the points on the line, but clicking on the outer line, i.e. the SVG / Chart-Body area can provide only X, Y, which are the coordinates of the planes and not the data.

Point on the chart:
circles = c.svg().selectAll 'circle.dot'
circles.on 'click', (d) ->
console.log 'POINT', 'Datum:', d
O / P:
POINT Datum:
{x: Fri Feb 01 1980 00:00:00 GMT+0000 (GMT Standard Time), y: 666}
Display external graph:
svg.on 'click', () ->
console.log 'SVG', d3.mouse(@)
O / P:
SVG [605.5, 394.5]
Now can I get the coordinates of the nearest data when I click on SVG? for example SVG [605.5, 394.5] will be (something like the nearest [X, Y] )
{x: Fri Feb 01 1980 00:00:00 GMT+0000 (GMT Standard Time), y: 666}
or in any other way to translate SVG X, Y into X, Y data?
Source data are presented in the form
[
{x: Fri Jan 01 1980 00:00:00 GMT+0000 (GMT Standard Time), y: 666},
{x: Fri Feb 01 1980 00:00:00 GMT+0000 (GMT Standard Time), y: 668},
{x: Fri Mar 01 1980 00:00:00 GMT+0000 (GMT Standard Time), y: 700},
{x: Fri Apr 01 1980 00:00:00 GMT+0000 (GMT Standard Time), y: 750},
.
.
.
{x: Fri Dec 01 2010 00:00:00 GMT+0000 (GMT Standard Time), y: 2000},
.
.
.
]