{"id":18614974,"url":"https://github.com/andrewjbateman/ionic-angular-stock-data","last_synced_at":"2025-04-11T00:31:00.765Z","repository":{"id":41743145,"uuid":"229043354","full_name":"AndrewJBateman/ionic-angular-stock-data","owner":"AndrewJBateman","description":":clipboard: Ionic app to chart historic stock prices from a financial data API. Take care if updating to ng16 or ng17 as chart.js and ng2-charts not Ivy compatible.","archived":false,"fork":false,"pushed_at":"2023-02-02T20:35:29.000Z","size":2093,"stargazers_count":9,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T06:51:14.849Z","etag":null,"topics":["angular","angular15","api-rest","financial-data","ionic","ionic6","ng2-charts","stock-price","tutorial-code"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-19T11:46:41.000Z","updated_at":"2023-11-11T11:31:48.000Z","dependencies_parsed_at":"2023-02-18T00:16:29.398Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/ionic-angular-stock-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-stock-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-stock-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-stock-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fionic-angular-stock-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/ionic-angular-stock-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322234,"owners_count":21084333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular15","api-rest","financial-data","ionic","ionic6","ng2-charts","stock-price","tutorial-code"],"created_at":"2024-11-07T03:27:40.124Z","updated_at":"2025-04-11T00:30:57.477Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","readme":"# :zap: Ionic Angular Charts\n\n* App to chart historic stock prices from the [FMP financial data API](https://financialmodelingprep.com/developer/docs) using the [Ionic framework](https://ionicframework.com/docs).\n* Includes tutorial from [Simon Grimm at Devdactic](https://www.youtube.com/channel/UCZZPgUIorPao48a1tBYSDgg) - see [:clap: Inspiration](#clap-inspiration) below. Changes added to show more API data using another http get request\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/ionic-angular-stock-data?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/ionic-angular-stock-data?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/ionic-angular-stock-data?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/ionic-angular-stock-data?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Ionic Angular Charts](#zap-ionic-angular-charts)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-do list](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Tutorial code changed to show example financial data on initialisation and clear the stock entry field (TSLA is shown) as I preferred this to initially seeing an empty graph.\n* Tutorial code changed to avoid use of string literals - `const history = res['historical'];` caused a typescript error.\n* Note: I had to reverse both x and y array values (date \u0026 stock price) so data would not display backwards.\n* **Important note on versions**: This only works with ng2-charts v2.4.2, chart.js v2.9.4 and chartjs-plugin-zoom v0.7.7. Updating to the latest versions of these chart-based dependencies will mean this app does NOT work without major reconfiguration.\n* [FMP financial data API](https://financialmodelingprep.com/developer/docs) free plan limited to 250 requests a day.\n\n## :camera: Screenshots\n\n![screenshot](./img/chart.png)\n\n## :signal_strength: Technologies\n\n* [Ionic v6](https://ionicframework.com/) framework.\n* [Ionic/angular v6](https://ionicframework.com/)\n* [Angular framework v15](https://angular.io/)\n* [rxjs library v7](https://angular.io/guide/rx-library) reactive prrogramming.\n* [ng2-charts v2](https://valor-software.com/ng2-charts/) line \u0026 bar charts.\n* [chart.js v2](https://www.chartjs.org/) datasets.\n* [chartjs-plugin-zoom v0.7.7](https://github.com/chartjs/chartjs-plugin-zoom)\n* [FMP financial data API](https://financialmodelingprep.com/developer/docs)\n\n## :floppy_disk: Setup\n\n* Install dependencies using `npm i`\n* API key: sign up with [FMP financial data API](https://financialmodelingprep.com) to get an API key.\n* Add API key to environments files\n* To start the server on _localhost://8100_ type: 'ionic serve -o'\n* Run `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory. \n\n## :computer: Code Examples\n\n* function to get data from API. Only stock variable is defined by user.\n\n```typescript\ngetData() {\n  this.http\n    .get(`\n      https://financialmodelingprep.com/api/v3/historical-price-full/\n      ${this.stock}?to=2022-02-02\u0026from=2017-02-02`).subscribe(res =\u003e {\n        const history = res['historical'];\n\n        this.chartLabels = [];\n        this.chartData[0].data = [];\n\n        for (const entry of history) {\n          this.chartLabels.push(entry.date);\n          this.chartData[0].data.push(entry.close);\n        }\n      });\n}\n```\n\n## :cool: Features\n\n* ng2-charts has 10 types of charts: line, bar, doughnut, radar, pie, polarArea, bubble, scatter, dynamic \u0026 financial. In this app the user can choose between line (default) and bar charts.\n\n## :clipboard: Status \u0026 To-do list\n\n* Status: Working\n* To-do: Nothing\n\n## :clap: Inspiration\n\n* [Simon Grimm Devdactic Youtube video 'How to Build Ionic 4 Apps with Chart.js'](https://www.youtube.com/watch?v=8sd99RJeYSk)\n* [Written version of tutorial: How to Build Ionic 4 Apps with Chart.js](https://devdactic.com/ionic-4-chartjs/)\n* [Github repo: antoinevulcain/Financial-Modeling-Prep-API](https://github.com/antoinevulcain/Financial-Modeling-Prep-API)\n* [JavaScript Array reverse() Method](https://www.w3schools.com/jsref/jsref_reverse.asp)\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fionic-angular-stock-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fionic-angular-stock-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fionic-angular-stock-data/lists"}