         
         updateOffsetWidths()
         
-        #if !TARGET_INTERFACE_BUILDER
-        // Animation loop for when the range adapts
-            /*
-        displayLink = CADisplayLink(target: self, selector: #selector(animationUpdate))
-        displayLink.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
-        displayLink.isPaused = true
-             */
-        #endif
-        
         isCurrentlySettingUp = false
         
         // Set the first active points interval. These are the points that are visible when the view loads.
         self.activePointsInterval = initialActivePointsInterval
-    }
-    
-    // Makes sure everything is in a clean state for when we want to reset the data for a graph.
-    private func reset() {
-        drawingView.removeFromSuperview()
-        referenceLineView?.removeFromSuperview()
-        
-        labelPool = LabelPool()
-        
-        for labelView in labelsView.subviews {
-            labelView.removeFromSuperview()
-        }
-        
-        for plot in plots {
-            plot.reset()
-        }
-        
-        previousActivePointsInterval = -1 ..< -1
-        activePointsInterval = -1 ..< -1
-        range = (0, 100)
     }
     
     // TODO in 4.1: Plot layer ordering.

        // Calculate the initial range depending on settings.
        let initialActivePointsInterval = calculateActivePointsInterval()
        
        //let detectedRange = calculateRange(forEntireDataset: self.data) // CHANGED
        /*
        if(shouldAutomaticallyDetectRange) {
            self.range = detectedRange
        }
        else {
            
        }
        */
        
        // CHANGED: Need to calculate the range across all plots to get the min and max for all plots.
        if (shouldAdaptRange) { // This overwrites anything specified by rangeMin and rangeMax
            let range = calculateRange(forActivePointsInterval: initialActivePointsInterval)
            self.range = range

        }
        */
        
        // Initialise all plots during setup.
        // This means all plots have to be added before the view appears on screen.
        for plot in plots {
            
            #if !TARGET_INTERFACE_BUILDER
                plot.setup() // Only init the animations for plots if we are not in IB
            #endif
            
            plot.createPlotPoints(numberOfPoints: numberOfDataPoints, range: range)
            
