comparison README.md @ 121:6d53542f6f9e

Small README fixes Hi! 👋 I just tried out this lib. It's really easy to integrate 👍 There are two compile errors in the Capsule Chart example, and the `dates` and `hours` in the `LineChartController` would be less surprising with a small comment. Here's my proposal how to make it even easier to get started 😊 Best Jannik committer: GitHub <noreply@github.com>
author Jannik Arndt <jannik@jannikarndt.de>
date Sun, 29 Aug 2021 13:40:06 +0200
parents 7cdc06d6a9cc
children f743a795707b
comparison
equal deleted inserted replaced
120:462fb542f386 121:6d53542f6f9e
25 You can customise the line chart with `LineChartController` 25 You can customise the line chart with `LineChartController`
26 26
27 ```swift 27 ```swift
28 LineChartController( 28 LineChartController(
29 prices: [Double], 29 prices: [Double],
30 dates: [String], 30 dates: [String]?, // format: yy-MM-dd
31 hours: [String], 31 hours: [String]?, // has to correspond to dates
32 labelColor: Color, 32 labelColor: Color,
33 indicatorPointColor: Color, 33 indicatorPointColor: Color,
34 showingIndicatorLineColor: Color, 34 showingIndicatorLineColor: Color,
35 flatTrendLineColor: Color, 35 flatTrendLineColor: Color,
36 uptrendLineColor: Color, 36 uptrendLineColor: Color,
66 struct ContentView: View { 66 struct ContentView: View {
67 var body: some View { 67 var body: some View {
68 RoundedRectangle(cornerRadius: 25) 68 RoundedRectangle(cornerRadius: 25)
69 .frame(width: 400, height: 120) 69 .frame(width: 400, height: 120)
70 .foregroundColor(.white) 70 .foregroundColor(.white)
71 .shadow(color: Color(,.gray).opacity(0.15), radius: 10) 71 .shadow(color: Color(.gray).opacity(0.15), radius: 10)
72 .overlay( 72 .overlay(
73 VStack(alignment: .leading) { 73 VStack(alignment: .leading) {
74 Text("Dennis Concepcion") 74 Text("Dennis Concepcion")
75 .font(.title3) 75 .font(.title3)
76 .fontWeight(.semibold) 76 .fontWeight(.semibold)
77 77
78 Text("Random guy") 78 Text("Random guy")
79 79
80 CapsuleChartView(percentageOfWidth: 0.6) 80 CapsuleChartView(percentageOfWidth: 0.6, style: CapsuleChartStyle(capsuleColor: Color.blue))
81 .padding(.top) 81 .padding(.top)
82 } 82 }
83 .padding() 83 .padding()
84 ) 84 )
85 } 85 }