Refactored resampling code out of ResampledBarDataSeries.