Compare commits

...

8 Commits

Author SHA1 Message Date
Andras Samu 94a98ee2c7 fixed public property 2019-09-30 10:28:01 +02:00
Andras Samu da015797dd fixed midnight green shade 2019-09-19 15:54:10 +02:00
Andras Samu 617297cbcd updated color preset names 2019-09-19 15:48:35 +02:00
Andras Samu 3909818a3f Add files via upload 2019-09-19 15:41:06 +02:00
Andras Samu df24b3d1c2 Update README.md 2019-09-19 15:40:00 +02:00
Andras Samu 07a16d5548 Update README.md 2019-09-19 15:39:20 +02:00
Andras Samu 4512fd0d3e Added midnight green color styles 2019-09-19 14:56:03 +02:00
Andras Samu 8a54155e47 Added public modifier 2019-09-11 22:08:33 +02:00
5 changed files with 43 additions and 5 deletions
+14
View File
@@ -69,6 +69,20 @@ Customizable:
BarChartView(data: [8,23,54,32,12,37,7,23,43], title: "Title", style: chartStyle)
```
You can access built-in styles:
```swift
BarChartView(data: [8,23,54,32,12,37,7,23,43], title: "Title", style: Styles.barChartMidnightGreen)
```
#### All styles available as a preset:
* barChartStyleOrangeLight
* barChartStyleOrangeDark
* barChartStyleNeonBlueLight
* barChartStyleNeonBlueDark
* barChartMidnightGreenLight
* barChartMidnightGreenDark
![Midnightgreen](./midnightgreen.gif "Midnightgreen")
![Custom Charts](./showcase5.png "Custom Charts")
+27 -3
View File
@@ -40,7 +40,7 @@ public struct Styles {
textColor: Color.black,
legendTextColor: Color.gray)
public static let barChartStyleOne = ChartStyle(
public static let barChartStyleOrangeLight = ChartStyle(
backgroundColor: Color.white,
accentColor: Colors.OrangeStart,
secondGradientColor: Colors.OrangeEnd,
@@ -48,7 +48,15 @@ public struct Styles {
textColor: Color.black,
legendTextColor: Color.gray)
public static let barChartStyleTwo = ChartStyle(
public static let barChartStyleOrangeDark = ChartStyle(
backgroundColor: Color.black,
accentColor: Colors.OrangeStart,
secondGradientColor: Colors.OrangeEnd,
chartFormSize: Form.medium,
textColor: Color.white,
legendTextColor: Color.gray)
public static let barChartStyleNeonBlueLight = ChartStyle(
backgroundColor: Color.white,
accentColor: Colors.GradientNeonBlue,
secondGradientColor: Colors.GradientPurple,
@@ -56,7 +64,7 @@ public struct Styles {
textColor: Color.black,
legendTextColor: Color.gray)
public static let barChartStyleThree = ChartStyle(
public static let barChartStyleNeonBlueDark = ChartStyle(
backgroundColor: Color.black,
accentColor: Colors.GradientNeonBlue,
secondGradientColor: Colors.GradientPurple,
@@ -64,6 +72,22 @@ public struct Styles {
textColor: Color.white,
legendTextColor: Color.gray)
public static let barChartMidnightGreenDark = ChartStyle(
backgroundColor: Color(hexString: "#36534D"), //3B5147, 313D34
accentColor: Color(hexString: "#FFD603"),
secondGradientColor: Color(hexString: "#FFCA04"),
chartFormSize: Form.medium,
textColor: Color.white,
legendTextColor: Color(hexString: "#D2E5E1"))
public static let barChartMidnightGreenLight = ChartStyle(
backgroundColor: Color.white,
accentColor: Color(hexString: "#84A094"), //84A094 , 698378
secondGradientColor: Color(hexString: "#50675D"),
chartFormSize: Form.medium,
textColor: Color.black,
legendTextColor:Color.gray)
public static let pieChartStyleOne = ChartStyle(
backgroundColor: Color.white,
accentColor: Colors.OrangeStart,
@@ -8,7 +8,7 @@
import SwiftUI
struct LineChartView: View {
public struct LineChartView: View {
let selectionFeedbackGenerator = UISelectionFeedbackGenerator()
@ObservedObject var data:ChartData
public var title: String
@@ -33,7 +33,7 @@ struct LineChartView: View {
self.style = style
}
var body: some View {
public var body: some View {
ZStack(alignment: .center){
RoundedRectangle(cornerRadius: 20).fill(self.style.backgroundColor).frame(width: frame.width, height: 240, alignment: .center).shadow(radius: 8)
VStack(alignment: .leading){
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB