             } else if plotField == .Y {
                 return reading.quantity
             }
-            
+
         }
         return nil
     }
-
-    // MARK: Axis Delegate Methods
+}
+
+// MARK: Axis Delegate Methods
+extension TrendViewController: CPTAxisDelegate {
 
     private func axis(_ axis: CPTAxis,
                       shouldUpdateAxisLabelsAtLocations locations: NSSet!) -> Bool {

        }
        return false
    }

    // doesn't get called. need to set a CPPlotSpaceDelegate property?
    // http://stackoverflow.com/questions/1892544/allow-horizontal-scrolling-only-in-the-core-plot-barchart/24525631#24525631
    // http://stackoverflow.com/questions/37898061/coreplot-vertical-scrolling-for-horizontal-bars
    func plotSpace(space: CPTPlotSpace,
                   willChangePlotRangeTo newRange: CPTPlotRange,
                   forCoordinate coordinate: CPTCoordinate) -> CPTPlotRange? {

        let range: CPTMutablePlotRange = CPTPlotRange(location: newRange.location,
                                                      length:newRange.length) as! CPTMutablePlotRange

        // Display only Quadrant I: never let the location go negative.
        //
        if range.locationDouble < 0.0 {
            range.location = 0.0
        }
        
        // Adjust axis to keep them in view at the left and bottom;
        // adjust scale-labels to match the scroll.
        //
        let axisSet: CPTXYAxisSet = space.graph!.axisSet as! CPTXYAxisSet
        if coordinate == CPTCoordinate.X {
            axisSet.yAxis?.orthogonalPosition = range.location
            axisSet.xAxis?.titleLocation = CPTDecimalFromDouble(range.locationDouble + (range.lengthDouble / 2.0)) as NSNumber?
        } else {
            axisSet.xAxis?.orthogonalPosition = range.location
            axisSet.yAxis?.titleLocation = CPTDecimalFromDouble(range.locationDouble + (range.lengthDouble / 2.0)) as NSNumber?
        }
        return range
    }


}

extension TrendViewController: CPTPlotDataSource {

    /** @brief @required The number of data points for the plot.
     *  @param plot The plot.
