diff Sources/StockCharts/CapsuleChart/CapsuleChartView.swift @ 116:5057c45046c1

Add default initializers
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Mon, 09 Aug 2021 16:32:45 +0100
parents b4901499ad40
children
line wrap: on
line diff
--- a/Sources/StockCharts/CapsuleChart/CapsuleChartView.swift	Thu Aug 05 15:45:42 2021 +0100
+++ b/Sources/StockCharts/CapsuleChart/CapsuleChartView.swift	Mon Aug 09 16:32:45 2021 +0100
@@ -9,11 +9,11 @@
 
 public struct CapsuleChartView: View {
     public var percentageOfWidth: CGFloat
-    public var style: CapsuleChartStyle
+    public var capsuleChartStyle: CapsuleChartStyle
     
     public init(percentageOfWidth: CGFloat, style: CapsuleChartStyle) {
         self.percentageOfWidth = percentageOfWidth
-        self.style = style
+        self.capsuleChartStyle = style
     }
     
     public var body: some View {
@@ -25,7 +25,7 @@
                         .opacity(0.2)
                     
                     Capsule()
-                        .foregroundColor(style.capsuleColor)
+                        .foregroundColor(capsuleChartStyle.capsuleColor)
                         .frame(width: proxy.size.width * percentageOfWidth)
                 }
                 .frame(height: 10)