function getNearestDataPoint(mouseX) {
            const adjustedMouseX = mouseX - margin.left;

            const nearest = transformedData.find(({key}) => {
                const barStart = xScale(key);
                const barEnd = barStart + xScale.bandwidth();

                // If mouseX is between barStart & barEnd
                return (adjustedMouseX >= barStart) && (adjustedMouseX < barEnd);
            });

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