From cdeec4cd4af2229522a6048d57ac8694b8771168 Mon Sep 17 00:00:00 2001 From: Albert Date: Mon, 17 May 2021 10:42:00 -0300 Subject: [PATCH 1/3] Fixing line chart view dynamic height --- Sources/SwiftUICharts/LineChart/LineChartView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftUICharts/LineChart/LineChartView.swift b/Sources/SwiftUICharts/LineChart/LineChartView.swift index 1e38b34f..ff2bf4c1 100644 --- a/Sources/SwiftUICharts/LineChart/LineChartView.swift +++ b/Sources/SwiftUICharts/LineChart/LineChartView.swift @@ -58,7 +58,7 @@ public struct LineChartView: View { ZStack(alignment: .center){ RoundedRectangle(cornerRadius: 20) .fill(self.colorScheme == .dark ? self.darkModeStyle.backgroundColor : self.style.backgroundColor) - .frame(width: frame.width, height: 240, alignment: .center) + .frame(width: frame.width, height: frame.height, alignment: .center) .shadow(color: self.style.dropShadowColor, radius: self.dropShadow ? 8 : 0) VStack(alignment: .leading){ if(!self.showIndicatorDot){ From 180df91f651b96a2a9acb7133307f37c67a12374 Mon Sep 17 00:00:00 2001 From: Albert Date: Mon, 17 May 2021 10:58:56 -0300 Subject: [PATCH 2/3] Fixing height to fit offset --- Sources/SwiftUICharts/LineChart/LineChartView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftUICharts/LineChart/LineChartView.swift b/Sources/SwiftUICharts/LineChart/LineChartView.swift index ff2bf4c1..9bf3762a 100644 --- a/Sources/SwiftUICharts/LineChart/LineChartView.swift +++ b/Sources/SwiftUICharts/LineChart/LineChartView.swift @@ -58,7 +58,7 @@ public struct LineChartView: View { ZStack(alignment: .center){ RoundedRectangle(cornerRadius: 20) .fill(self.colorScheme == .dark ? self.darkModeStyle.backgroundColor : self.style.backgroundColor) - .frame(width: frame.width, height: frame.height, alignment: .center) + .frame(width: frame.width, height: self.formSize.height + 30, alignment: .center) .shadow(color: self.style.dropShadowColor, radius: self.dropShadow ? 8 : 0) VStack(alignment: .leading){ if(!self.showIndicatorDot){ From 7fe65267ef9f22ba0dd352442c2025a05cbf1393 Mon Sep 17 00:00:00 2001 From: Albert Rayneer Date: Wed, 26 May 2021 10:17:33 -0300 Subject: [PATCH 3/3] Adding line chart view colors --- Sources/SwiftUICharts/LineChart/Line.swift | 2 +- Sources/SwiftUICharts/LineChart/LineChartView.swift | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftUICharts/LineChart/Line.swift b/Sources/SwiftUICharts/LineChart/Line.swift index d29c1874..7e752b3e 100644 --- a/Sources/SwiftUICharts/LineChart/Line.swift +++ b/Sources/SwiftUICharts/LineChart/Line.swift @@ -62,7 +62,7 @@ public struct Line: View { ZStack { if(self.showFull && self.showBackground){ self.closedPath - .fill(LinearGradient(gradient: Gradient(colors: [Colors.GradientUpperBlue, .white]), startPoint: .bottom, endPoint: .top)) + .fill(LinearGradient(gradient: Gradient(colors: [gradient.start, gradient.end]), startPoint: .bottom, endPoint: .top)) .rotationEffect(.degrees(180), anchor: .center) .rotation3DEffect(.degrees(180), axis: (x: 0, y: 1, z: 0)) .transition(.opacity) diff --git a/Sources/SwiftUICharts/LineChart/LineChartView.swift b/Sources/SwiftUICharts/LineChart/LineChartView.swift index 9bf3762a..83f6eba3 100644 --- a/Sources/SwiftUICharts/LineChart/LineChartView.swift +++ b/Sources/SwiftUICharts/LineChart/LineChartView.swift @@ -105,7 +105,8 @@ public struct LineChartView: View { touchLocation: self.$touchLocation, showIndicator: self.$showIndicatorDot, minDataValue: .constant(nil), - maxDataValue: .constant(nil) + maxDataValue: .constant(nil), + gradient: self.style.gradientColor ) } .frame(width: frame.width, height: frame.height)