Compare commits

..

6 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
5 changed files with 28 additions and 6 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")
+13 -5
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,8 +72,8 @@ public struct Styles {
textColor: Color.white,
legendTextColor: Color.gray)
public static let barChartMidnightGreen = ChartStyle(
backgroundColor: Color(hexString: "#3B5147"), //3B5147, 313D34
public static let barChartMidnightGreenDark = ChartStyle(
backgroundColor: Color(hexString: "#36534D"), //3B5147, 313D34
accentColor: Color(hexString: "#FFD603"),
secondGradientColor: Color(hexString: "#FFCA04"),
chartFormSize: Form.medium,
@@ -33,7 +33,7 @@ public 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