Calculating the min and max values for yScale.