Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
denniscmcom committed Jun 5, 2021
1 parent 09d4321 commit 9f561a3
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,47 @@ import StockCharts
LineChartView(data: [Double], dates: [String]?, hours: [String]?, dragGesture: Bool?)
```

#### Arguments
```swift
data: [120.3, 121.0, 132.4, ...]
dates: ["yyyy-MM-dd", "2021-01-01", "2021-01-02", ...]
hours: ["10:20", "10:21", "10:22", ...] // It could be any format
dragGesture: false // By default is true
```
<img width="374" alt="LineChartVideo" src="https://user-images.githubusercontent.com/66180929/116899623-137c6e80-ac38-11eb-8ec0-e678aea54062.gif">

### Capsule chart
```swift
CapsuleChartView(percentageOfWidth: CGFloat)
// percentageOfWidth: must be 0 <= x <= 1
```

#### Example
```swift
import SwiftUI
import StockCharts

struct ContentView: View {
var body: some View {
RoundedRectangle(cornerRadius: 25)
.frame(width: 400, height: 120)
.foregroundColor(.white)
.shadow(color: Color(.gray).opacity(0.15), radius: 10)
.overlay(
VStack(alignment: .leading) {
Text("Dennis Concepcion")
.font(.title3)
.fontWeight(.semibold)

Text("Random guy")

CapsuleChartView(percentageOfWidth: 0.6)
.padding(.top)
}
.padding()
)
}
}
```

<img width="328" alt="CapsuleChart" src="https://user-images.githubusercontent.com/66180929/120899384-c2450d80-c62f-11eb-9a56-5a03e97441d2.png">

0 comments on commit 9f561a3

Please sign in to comment.