         }
         */
         
+        // Initialise all plots during setup.
+        // This means all plots have to be added before the view appears on screen.
         for plot in plots {
-            plot.setup()
-            
-            //plot.createGraphPoints(data: data, shouldAnimateOnStartup: shouldAnimateOnStartup, range: self.range) // CHANGED
+            
+            #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)
             

        
        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.

        
        for plot in plots {
            let dataForPointsToAnimate = getData(forPlot: plot, andActiveInterval: pointsToAnimate)
            plot.startAnimations(forPoints: pointsToAnimate, withData: dataForPointsToAnimate, withStaggerValue: stagger)
        }
    }
    
