docs: function findNearbyItem(mouseX, mouseY, seriesFilter, radius, computeDistance) {
              var maxDistance = radius,
                  smallestDistance = maxDistance * maxDistance + 1,
                  item = null,
                  dx, dy, dist,
                  i, j, ps;
  
              for (i = series.length - 1; i >= 0; --i) {
                  if (!seriesFilter(i)) continue;
  
                  var s = series[i];
                  if (!s.datapoints) return;
                  var x, y,
                      axisx = s.xaxis,
                      axisy = s.yaxis,
                      points = s.datapoints.points,
                      mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster
                      my = axisy.c2p(mouseY),
                      maxx = maxDistance / axisx.scale,
                      maxy = maxDistance / axisy.scale;
  
                  ps = s.datapoints.pointsize;
                  // with inverse transforms, we can't use the maxx/maxy
                  // optimization, sadly
                  if (axisx.options.inverseTransform) {
                      maxx = Number.MAX_VALUE;
                  }
  
                  if (axisy.options.inverseTransform) {
                      maxy = Number.MAX_VALUE;
                  }
  
                  for (j = 0; j < points.length; j += ps) {
                      x = points[j];
                      y = points[j + 1];
                      if (x == null) {
                          continue;
                      }
  
                      if (x - mx > maxx || x - mx < -maxx ||
                          y - my > maxy || y - my < -maxy) {
                          continue;
                      }
  
                      // We have to calculate distances in pixels, not in
                      // data units, because the scales of the axes may be different
                      dx = Math.abs(axisx.p2c(x) - mouseX);
                      dy = Math.abs(axisy.p2c(y) - mouseY);
                      dist = computeDistance ? computeDistance(dx, dy) : dx * dx + dy * dy;
  
                      // use <= to ensure last point takes precedence
                      // (last generally means on top of)
                      if (dist < smallestDistance) {
                          smallestDistance = dist;
                          item = [i, j / ps];
                      }
                  }
              }
  
              if (item) {
                  i = item[0];
                  j = item[1];
                  ps = series[i].datapoints.pointsize;
  
                  return {
                      datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),
                      dataIndex: j,
                      series: series[i],
                      seriesIndex: i
                  };
              }
  
              return null;
          }