function findOutNearestDate(x0, d0, d1){
            if(xAxisValueType === 'number') {
                return (x0 - d0.date) > (d1.date - x0) ? d0 : d1;
            }

            return (new Date(x0).getTime() - new Date(d0.date).getTime()) > (new Date(d1.date).getTime() - new Date(x0).getTime()) ? d0 : d1;
        }
Finds out which datapoint is closer to the given x position
@param  {Number} x0 Date or number value for data point
@param  {Object} d0 Previous datapoint
@param  {Object} d1 Next datapoint
@return {Object}    d0 or d1, the datapoint with closest date to x0