Mercurial > public > stock-charts
changeset 127:fc066e00f4b6
Change info files
author | Dennis <dennis@denniscm.com> |
---|---|
date | Fri, 11 Aug 2023 18:53:38 +0000 |
parents | 22b9e6834fc0 |
children | 212573e8b5d4 |
files | .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/workflows/swift.yml CHANGELOG.md DOCS.md LICENSE.md README.md |
diffstat | 7 files changed, 229 insertions(+), 175 deletions(-) [+] |
line wrap: on
line diff
--- 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.
--- 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.
--- 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'
--- /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) + + +<a id="orgdbd1c4f"></a> + +# 2021-08-09 -> Version 1.2.0 + +Remove on push triggers + + +<a id="org17d583f"></a> + +# 2021-07-17 -> Minor UI improvements + + +<a id="orge71a9c9"></a> + +# 2021-06-28 -> Change colors to SwiftUI native + + +<a id="orgbc1f4da"></a> + +# 2021-06-27 -> WatchOS compatibility + + +<a id="org68756eb"></a> + +# 2021-06-22 -> UI Chart label changer + + +<a id="org460d505"></a> + +# 2021-06-16 -> Fix unwrap crash + +Fix crash when `path.currentPoint` was `nil` in `LinePath.swift` + + +<a id="org17e1907"></a> + +# 2021-06-06 -> Fix bug color LineChartView on dragGesture + + +<a id="org5ae752f"></a> + +# 2021-06-06 -> Fix `Index out of range` when data is empty + + +<a id="org14a9a79"></a> + +# 2021-06-05 -> Add CapsuleChart + + +<a id="org4f37163"></a> + +# 2021-05-19 -> Fix builder issues + + +<a id="orgb3b26d6"></a> + +# 2021-05-08 -> Fix warning `Modifying state during view update` + + +<a id="orgc348d6d"></a> + +# 2021-05-08 -> Fix folder structure bug + + +<a id="org1c3026a"></a> + +# 2021-05-07 -> Delete demo project + + +<a id="org079f167"></a> + +# 2021-05-07 -> v1.1 + +Add `dragGesture` argument + + +<a id="org1235ab7"></a> + +# 2021-04-30 -> v1.0 + + +<a id="org9285a3b"></a> + +# 2021-05-28 -> v0.2-alpha + + +<a id="org6f2747e"></a> + +# 2021-05-28 -> v0.1-alpha +
--- /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) + + +<a id="orgd9f2fd7"></a> + +# Installation + +- In Xcode go to `File` -> `Swift packages` -> `Add package dependency` +- Copy and paste `https://github.com/denniscmartin/stock-charts.git` + + +<a id="orgbd9420c"></a> + +# 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) + + +<a id="org57f1418"></a> + +# Usage + + import StockCharts + + +<a id="org19fa053"></a> + +## 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 + ) + ) + + +<a id="orgc225fff"></a> + +## Capsule chart + + CapsuleChartView(percentageOfWidth: CGFloat) + // percentageOfWidth: must be 0 <= x <= 1 + + +<a id="org71304cd"></a> + +### 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() + ) + } + } +
--- 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. +
--- 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. + <a href="https://www.producthunt.com/posts/stockcharts-for-swiftui?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-stockcharts-for-swiftui" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=295975&theme=dark" alt="StockCharts for SwiftUI - Display interactive stock charts easily 🎉 | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a> -# SwiftUI Stock Charts [ARCHIVED] - -**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: <https://denniscm.com/proj/stock-charts.html> +- Main repo on SourceHut: <https://git.sr.ht/~denniscmartin/stock-charts> + - Mirrors: + - Github: <https://github.com/denniscmartin/stock-charts> + - Gitlab: <https://gitlab.com/denniscmartin/stock-charts> -```swift -LineChartView( - lineChartController: - LineChartController( - prices: [Double], - dragGesture: 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, style: CapsuleChartStyle(capsuleColor: Color.blue)) - .padding(.top) - } - .padding() - ) - } -} -``` - -<img width="328" alt="CapsuleChart" src="https://user-images.githubusercontent.com/66180929/120899384-c2450d80-c62f-11eb-9a56-5a03e97441d2.png"> -