Skip to content

Commit

Permalink
fix d3 js (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
whereismyjetpack authored Mar 27, 2023
1 parent 6ccd465 commit d4bea48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/javascript/frontend/scripts/view_statistics_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ function drawChart (selection, data) {
// Binary search function to look up closet data point to a given date
const bisectDate = d3.bisector(row => row[0])

svg.on('mousemove click touchmove', function () {
const mouseCoords = d3.pointer(this)
svg.on('mousemove click touchmove', (event) => {
const mouseCoords = d3.pointer(event)
const mouseDate = x.invert(mouseCoords[0])
const [nearestDate,, nearestValue] = findNearestDataPoint(bisectDate, data, mouseDate)

Expand Down

0 comments on commit d4bea48

Please sign in to comment.