         
         if (dataSet.isDrawFilledEnabled)
         {
-            drawCubicFill(context: context, dataSet: dataSet, spline: cubicPath, matrix: valueToPixelMatrix, from: minx, to: maxx);
+            drawCubicFill(context: context, dataSet: dataSet, spline: cubicPath, matrix: valueToPixelMatrix, from: minx, to: size);
         }
         
         CGContextBeginPath(context);

        minx = max(minx - 2, 0); // Decrement by 2 as we always render two extra points to keep cubic flowing
        size = min(size + 2, entries.count); // Increment by 1 as we always render two extra points to keep cubic flowing
        
        if (size - minx >= 4)
        {
            var prevDx: CGFloat = 0.0;
            var prevDy: CGFloat = 0.0;

            {
                cur = entries[entries.count - 1];
                prev = entries[entries.count - 2];
                prevPrev = entries[entries.count - (entries.count >= 3 ? 3 : 2)];
                next = cur;
                
                prevDx = CGFloat(cur.xIndex - prevPrev.xIndex) * intensity;
