# HG changeset patch # User Dennis # Date 1691780018 0 # Node ID fc066e00f4b63f37e43ee5ee2e428dc3abe1f6be # Parent 22b9e6834fc0b09fa34a22be9c2cfa8ea478a2af Change info files diff -r 22b9e6834fc0 -r fc066e00f4b6 .github/ISSUE_TEMPLATE/bug_report.md --- a/.github/ISSUE_TEMPLATE/bug_report.md Sun Jun 04 18:14:19 2023 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff -r 22b9e6834fc0 -r fc066e00f4b6 .github/ISSUE_TEMPLATE/feature_request.md --- a/.github/ISSUE_TEMPLATE/feature_request.md Sun Jun 04 18:14:19 2023 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff -r 22b9e6834fc0 -r fc066e00f4b6 .github/workflows/swift.yml --- a/.github/workflows/swift.yml Sun Jun 04 18:14:19 2023 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -name: test - -# We will trigger this workflow whenever someone pushes or pull request to the repo. -on: - pull_request: - branches: [ main ] - -jobs: - build: - - # We want our unit tests to be run on the latest available version of - # macOS that Github Actions supports. - runs-on: macOS-latest - - steps: - - uses: actions/checkout@v1 - # Github Actions' machines do in fact have recent versions of Xcode, - # but you may have to explicitly switch to them. We explicitly want - # to use Xcode 11, so we use xcode-select to switch to it. - - - name: Generate xcodeproj - run: swift package generate-xcodeproj - # Finally, we invoke xcodebuild to run the tests on an iPhone 11 - # simulator. - - - name: Run tests on iPhone 12 - run: xcodebuild test -destination 'name=iPhone 12' -scheme 'StockCharts' diff -r 22b9e6834fc0 -r fc066e00f4b6 CHANGELOG.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CHANGELOG.md Fri Aug 11 18:53:38 2023 +0000 @@ -0,0 +1,112 @@ + +# Table of Contents + +1. [2021-08-09 -> Version 1.2.0](#orgdbd1c4f) +2. [2021-07-17 -> Minor UI improvements](#org17d583f) +3. [2021-06-28 -> Change colors to SwiftUI native](#orge71a9c9) +4. [2021-06-27 -> WatchOS compatibility](#orgbc1f4da) +5. [2021-06-22 -> UI Chart label changer](#org68756eb) +6. [2021-06-16 -> Fix unwrap crash](#org460d505) +7. [2021-06-06 -> Fix bug color LineChartView on dragGesture](#org17e1907) +8. [2021-06-06 -> Fix `Index out of range` when data is empty](#org5ae752f) +9. [2021-06-05 -> Add CapsuleChart](#org14a9a79) +10. [2021-05-19 -> Fix builder issues](#org4f37163) +11. [2021-05-08 -> Fix warning `Modifying state during view update`](#orgb3b26d6) +12. [2021-05-08 -> Fix folder structure bug](#orgc348d6d) +13. [2021-05-07 -> Delete demo project](#org1c3026a) +14. [2021-05-07 -> v1.1](#org079f167) +15. [2021-04-30 -> v1.0](#org1235ab7) +16. [2021-05-28 -> v0.2-alpha](#org9285a3b) +17. [2021-05-28 -> v0.1-alpha](#org6f2747e) + + + + +# 2021-08-09 -> Version 1.2.0 + +Remove on push triggers + + + + +# 2021-07-17 -> Minor UI improvements + + + + +# 2021-06-28 -> Change colors to SwiftUI native + + + + +# 2021-06-27 -> WatchOS compatibility + + + + +# 2021-06-22 -> UI Chart label changer + + + + +# 2021-06-16 -> Fix unwrap crash + +Fix crash when `path.currentPoint` was `nil` in `LinePath.swift` + + + + +# 2021-06-06 -> Fix bug color LineChartView on dragGesture + + + + +# 2021-06-06 -> Fix `Index out of range` when data is empty + + + + +# 2021-06-05 -> Add CapsuleChart + + + + +# 2021-05-19 -> Fix builder issues + + + + +# 2021-05-08 -> Fix warning `Modifying state during view update` + + + + +# 2021-05-08 -> Fix folder structure bug + + + + +# 2021-05-07 -> Delete demo project + + + + +# 2021-05-07 -> v1.1 + +Add `dragGesture` argument + + + + +# 2021-04-30 -> v1.0 + + + + +# 2021-05-28 -> v0.2-alpha + + + + +# 2021-05-28 -> v0.1-alpha + diff -r 22b9e6834fc0 -r fc066e00f4b6 DOCS.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DOCS.md Fri Aug 11 18:53:38 2023 +0000 @@ -0,0 +1,103 @@ + +# Table of Contents + +1. [Installation](#orgd9f2fd7) +2. [Demo app](#orgbd9420c) +3. [Usage](#org57f1418) + 1. [Line chart](#org19fa053) + 2. [Capsule chart](#orgc225fff) + 1. [Example](#org71304cd) + + + + +# Installation + +- In Xcode go to `File` -> `Swift packages` -> `Add package dependency` +- Copy and paste `https://github.com/denniscmartin/stock-charts.git` + + + + +# Demo app + +I've created an example app to show real use cases of this framework, check -> [Trades app](https://github.com/denniscmartin/trades-demo) + + + + +# Usage + + import StockCharts + + + + +## Line chart + + let lineChartController = LineChartController(prices: [Double]) + LineChartView(lineChartController: lineChartController) + +You can customise the line chart with `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` + + LineChartView( + lineChartController: + LineChartController( + prices: [Double], + dragGesture: true + ) + ) + + + + +## Capsule chart + + CapsuleChartView(percentageOfWidth: CGFloat) + // percentageOfWidth: must be 0 <= x <= 1 + + + + +### Example + + 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() + ) + } + } + diff -r 22b9e6834fc0 -r fc066e00f4b6 LICENSE.md --- a/LICENSE.md Sun Jun 04 18:14:19 2023 +0100 +++ b/LICENSE.md Fri Aug 11 18:53:38 2023 +0000 @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Dennis Concepción Martín +Copyright (c) 2023 Dennis Concepción Martín Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,3 +19,4 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff -r 22b9e6834fc0 -r fc066e00f4b6 README.md --- a/README.md Sun Jun 04 18:14:19 2023 +0100 +++ b/README.md Fri Aug 11 18:53:38 2023 +0000 @@ -1,92 +1,15 @@ + +# stock-charts [DEPRECATED] + +Now, there is a way to make charts with a native API, check -> [Charts](https://developer.apple.com/documentation/charts). + +A library to display interactive charts in SwiftUI. + StockCharts for SwiftUI - Display interactive stock charts easily 🎉 | Product Hunt -# SwiftUI Stock Charts [ARCHIVED] -![Build Status](https://github.com/denniscm190/StockCharts/actions/workflows/swift.yml/badge.svg) -**This package is deprecated, please see [Swift Charts](https://developer.apple.com/documentation/charts)** - -Display interactive stock charts easily 🎉 - -## Instalation -- In Xcode go to `File` -> `Swift packages` -> `Add package dependency` -- Copy and paste `https://github.com/denniscm190/StockCharts.git` - -## Demo app -[**Trades** is a SwiftUI app](https://github.com/denniscm190/trades-demo) with real use cases of the StockCharts `framework`. - -## Usage -```swift -import StockCharts -``` - -### Line chart -```swift -let lineChartController = LineChartController(prices: [Double]) -LineChartView(lineChartController: lineChartController) -``` - -You can customise the line chart with `LineChartController` - -```swift -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 ` +- Docs: +- Main repo on SourceHut: + - Mirrors: + - Github: + - Gitlab: -```swift -LineChartView( - lineChartController: - LineChartController( - prices: [Double], - dragGesture: true - ) -) -``` -LineChartVideo - -### 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, style: CapsuleChartStyle(capsuleColor: Color.blue)) - .padding(.top) - } - .padding() - ) - } -} -``` - -CapsuleChart -