         return (x: (p2.x * dy1 - p1.x * dy2) / (dy1 - dy2), y: level)
     }
 }
+
+extension Sequence where Element == Double {
+
+    func minOrZero() -> Double {
+        return self.min() ?? 0.0
+    }
+
+    func maxOrZero() -> Double {
+        return self.max() ?? 0.0
+    }
+}

        } else {
            return scaleValueOnYAxis(zeroLevel)
        }

    }

    // MARK: - Drawings

            let segments = Chart.segmentLine(series.data as ChartLineSegment, zeroLevel: series.colors.zeroLevel)

            segments.forEach({ segment in
                let scaledXValues = scaleValuesOnXAxis( segment.map { $0.x } )
                let scaledYValues = scaleValuesOnYAxis( segment.map { $0.y } )

                if series.line {
                    drawLine(scaledXValues, yValues: scaledYValues, seriesIndex: index)
