https://github.com/codad5/php-csv-to-chart
Convert a csv file to chart using chart.js
https://github.com/codad5/php-csv-to-chart
chartjs csv php
Last synced: 12 months ago
JSON representation
Convert a csv file to chart using chart.js
- Host: GitHub
- URL: https://github.com/codad5/php-csv-to-chart
- Owner: codad5
- Created: 2022-10-16T18:43:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-18T22:02:15.000Z (over 3 years ago)
- Last Synced: 2025-02-10T15:13:01.933Z (about 1 year ago)
- Topics: chartjs, csv, php
- Language: PHP
- Homepage: http://php-csv-chart.sanctablog.com/
- Size: 291 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About the project
This is a project that reads a csv file with data of dollar rate and the date but i am required to read the csv file and convert it to a virtual presentation in php
## Approaches
- I will use [chart.js](https://www.chartjs.org) for a chart representaton
- I used [php-router library](https://github.com/aosasona/php-router) for easy routing.
- For showing the chart i built a mini api to be consumed by the frontend while other datas are been echoed out directly
### Running it
##### Clone the project
```bash
git clone https://github.com/codad5/php-csv-to-chart
```
##### Install all dependecies
```bash
composer install
```
##### Serve Your Project
```shell
php -S localhost:2000
```


###### Added Filter

### Routes
- Index route `/` - This Shows the list of all avaliable rates and dates and also show then in a chart form
- `/rates/:date` - This is to show the rate of a particular date given
- `/api/rates` - This is to get all rate data
- `/api/rates/:date` - This is to get a particular rate based on the given date