scales the data and calculates range and interval