Merge pull request #23 from denniscmartin/denniscmartin-patch-1 Update README.md
Merge pull request #23 from denniscmartin/denniscmartin-patch-1
Update README.md
This package is deprecated, please see Swift Charts
Display interactive stock charts easily 🎉
File
Swift packages
Add package dependency
https://github.com/denniscm190/StockCharts.git
Trades is a SwiftUI app with real use cases of the StockCharts framework.
framework
import StockCharts
let lineChartController = LineChartController(prices: [Double]) LineChartView(lineChartController: lineChartController)
You can customise the line chart with LineChartController
LineChartController
LineChartController( prices: [Double], dates: [String]?, // format: yy-MM-dd hours: [String]?, // has to correspond to dates labelColor: Color, indicatorPointColor: Color, showingIndicatorLineColor: Color, flatTrendLineColor: Color, uptrendLineColor: Color, downtrendLineColor: Color, dragGesture: Bool )
To enable the drag gesture set dragGesture to true in the LineChartController
dragGesture
true
LineChartView( lineChartController: LineChartController( prices: [Double], dragGesture: true ) )
CapsuleChartView(percentageOfWidth: CGFloat) // percentageOfWidth: must be 0 <= x <= 1
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, style: CapsuleChartStyle(capsuleColor: Color.blue)) .padding(.top) } .padding() ) } }
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
SwiftUI Stock Charts [ARCHIVED]
This package is deprecated, please see Swift Charts
Display interactive stock charts easily 🎉
Instalation
File
->Swift packages
->Add package dependency
https://github.com/denniscm190/StockCharts.git
Demo app
Trades is a SwiftUI app with real use cases of the StockCharts
framework
.Usage
Line chart
You can customise the line chart with
LineChartController
To enable the drag gesture set
dragGesture
totrue
in theLineChartController
Capsule chart
Example