                 entryTo = dataSet.entryForXIndex(self.maxX, rounding: .Up)
                 else { continue }
             
-            let diff = (entryFrom == entryTo) ? 1 : 0
+            var diff = (entryFrom == entryTo) ? 1 : 0
+            if dataSet.mode == .CubicBezier
+            {
+                diff += 1
+            }
+            
             let minx = max(dataSet.entryIndex(entry: entryFrom) - diff, 0)
             let maxx = min(max(minx + 2, dataSet.entryIndex(entry: entryTo) + 1), entryCount)
             

                    entryTo = dataSet.entryForXIndex(self.maxX, rounding: .Up)
                    else { continue }
                
                let diff = (entryFrom == entryTo) ? 1 : 0
                let minx = max(dataSet.entryIndex(entry: entryFrom) - diff, 0)
                let maxx = min(max(minx + 2, dataSet.entryIndex(entry: entryTo) + 1), entryCount)
                

            entryTo = dataSet.entryForXIndex(self.maxX, rounding: .Up)
            else { return }
        
        var diff = (entryFrom == entryTo) ? 1 : 0
        if dataSet.mode == .CubicBezier
        {
            diff += 1
        }
        
        let minx = max(dataSet.entryIndex(entry: entryFrom) - diff, 0)
        let maxx = min(max(minx + 2, dataSet.entryIndex(entry: entryTo) + 1), entryCount)
        
