function getNearestDataPoint(mouseX) {
            let dateFromInvertedX = xScale.invert(mouseX);
            let bisectDate = d3Array.bisector(getDate).left;
            let dataEntryIndex = bisectDate(dataSorted, dateFromInvertedX, 1);
            let dataEntryForXPosition = dataSorted[dataEntryIndex];
            let previousDataEntryForXPosition = dataSorted[dataEntryIndex - 1];
            let nearestDataPoint;

            if (previousDataEntryForXPosition && dataEntryForXPosition) {
                nearestDataPoint = findOutNearestDate(dateFromInvertedX, dataEntryForXPosition, previousDataEntryForXPosition);
            } else {
                nearestDataPoint = dataEntryForXPosition;
            }

            return nearestDataPoint;
        }
Finds out the data entry that is closer to the given position on pixels
@param  {Number} mouseX X position of the mouse
@return {Object}        Data entry that is closer to that x axis position