diff Sources/StockCharts/LineChart/Helpers/ChartLabel.swift @ 108:f53d8b9ca92b

Custom style implemented
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Sun, 04 Jul 2021 16:40:24 +0100
parents 0c0d38dca6d8
children 5057c45046c1
line wrap: on
line diff
--- a/Sources/StockCharts/LineChart/Helpers/ChartLabel.swift	Mon Jun 28 14:01:13 2021 +0200
+++ b/Sources/StockCharts/LineChart/Helpers/ChartLabel.swift	Sun Jul 04 16:40:24 2021 +0100
@@ -11,6 +11,7 @@
     public var data: [Double]
     public var dates: [String]?
     public var hours: [String]?
+    public var style: LineChartStyle
     
     @Binding var indexPosition: Int  // Data point position
     
@@ -29,7 +30,7 @@
                 }
                 
                 Text("\(data[indexPosition], specifier: "%.2f")")
-                    .foregroundColor(Color.blue)
+                    .foregroundColor(style.labelColor)
                 
             }
             .font(.caption)