mirror of
https://github.com/seigler/neat-charts
synced 2025-07-26 17:06:09 +00:00
added shields, updated installation instructions
This commit is contained in:
parent
352794cbfc
commit
6c0ea036a0
1 changed files with 34 additions and 18 deletions
52
README.md
52
README.md
|
@ -1,4 +1,5 @@
|
||||||
# NeatCharts
|
# seigler/neat-charts [](https://github.com/seigler/neat-charts/stargazers) [](https://packagist.org/packages/seigler/neat-charts) [](https://github.com/seigler/neat-charts) [](https://github.com/seigler/neat-charts/blob/master/LICENSE.txt)
|
||||||
|
|
||||||
PHP project to generate clean-looking SVG price charts
|
PHP project to generate clean-looking SVG price charts
|
||||||
|
|
||||||

|

|
||||||
|
@ -6,29 +7,44 @@ PHP project to generate clean-looking SVG price charts
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* PHP
|
* PHP >=5.3.0
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
Best:
|
### Using Composer
|
||||||
add a composer dependency on `seigler/neat-charts`.
|
|
||||||
|
|
||||||
Next best:
|
To install using Composer, you will have to install Composer first.
|
||||||
Copy the how it's done in `/demo/index.php`.
|
|
||||||
|
`curl -s https://getcomposer.org/installer | php`
|
||||||
|
|
||||||
|
Create a composer.json file in your project root.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"seigler/neat-charts": "@dev"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Tell Composer to install the required dependencies.
|
||||||
|
|
||||||
|
`php composer.phar install`
|
||||||
|
|
||||||
|
If you want to use the autoloading provided by Composer, add the following line to your application file.
|
||||||
|
|
||||||
|
`require 'vendor/autoload.php';`
|
||||||
|
|
||||||
|
You are now ready to use NeatCharts.
|
||||||
|
|
||||||
|
### Install NeatCharts manually
|
||||||
|
|
||||||
|
Just download the NeatCharts class and require it in your application file.
|
||||||
|
|
||||||
|
`require 'NeatCharts.php';`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
With Composer:
|
|
||||||
`composer require seigler/neat-charts`
|
|
||||||
|
|
||||||
In your PHP file:
|
|
||||||
```php
|
```php
|
||||||
<?php
|
|
||||||
Header('Content-type: image/svg+xml; charset=utf-8');
|
Header('Content-type: image/svg+xml; charset=utf-8');
|
||||||
Header('Content-Disposition: inline; filename="chart-' . date('Y-m-d\THisT') . '.svg"');
|
|
||||||
require 'NeatCharts/LineChart.php'; // better to use composer, require "seigler/neat-charts".
|
|
||||||
|
|
||||||
/*
|
|
||||||
your code here to populate $chartData
|
|
||||||
*/
|
|
||||||
|
|
||||||
$chart = new NeatCharts/LineChart($chartData, [ // all parameters optional
|
$chart = new NeatCharts/LineChart($chartData, [ // all parameters optional
|
||||||
'width'=>800,
|
'width'=>800,
|
||||||
|
@ -45,5 +61,5 @@ In your HTML:
|
||||||
|
|
||||||
## Credits
|
## Credits
|
||||||
|
|
||||||
* Demo's output caching based on http://www.the-art-of-web.com/php/buffer/
|
* Demo output caching based on http://www.the-art-of-web.com/php/buffer/
|
||||||
* Chart appearance based on advice found at http://vis4.net/blog/posts/doing-the-line-charts-right/
|
* Chart appearance based on advice found at http://vis4.net/blog/posts/doing-the-line-charts-right/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue