dev-master
9999999-dev https://github.com/seigler/neat-chartsGenerates clean-looking SVG charts
MIT
The Requires
- php >=5.3.0
chart svg charts
Wallogit.com
2017 © Pedro Peláez
Generates clean-looking SVG charts
PHP project to generate clean-looking SVG price charts, (*1)
30 days of Dash price in Bitcoin from Poloniex.com, (*2)
Ethereum 7-day price in BTC from Poloniex , (*3)
More examples at cryptohistory.org., (*4)
To install using Composer, you will have to install Composer first., (*5)
curl -s https://getcomposer.org/installer | php, (*6)
Create a composer.json file in your project root. Then run this command in your project folder:, (*7)
composer require seigler/neat-charts, (*8)
Tell Composer to install the required dependencies., (*9)
php composer.phar install, (*10)
If you want to use the autoloading provided by Composer, add the following line to your application file., (*11)
require 'vendor/autoload.php';, (*12)
You are now ready to use NeatCharts., (*13)
Download the folder NeatCharts (in src) and place it alongside your php file. Add the following at the top of your PHP file:, (*14)
spl_autoload_extensions(".php");
spl_autoload_register();
This will automatically require the correct files when they are referenced, since the namespace and class names match the folder structure., (*15)
Header('Content-type: image/svg+xml; charset=utf-8');
$chart = new NeatCharts/LineChart($chartData, [ // all parameters optional
'width'=>800,
'height'=>250,
'lineColor'=>"#1C75BC",
'labelColor'=>"#777",
'smoothed'=>false
]);
print '';
print $chart->render();
In your HTML:
<img src="path to the PHP file">, (*16)
There are more demos available in demo.php and demo-as-image.php., (*17)
| Option | Default |
|---|---|
| width | 800 |
| height | 250 |
| lineColor | '#000' |
| markerColor | '#000' |
| labelColor | '#000' |
| smoothed | false |
| fontSize | 15 |
| yAxisEnabled | true |
| xAxisEnabled | false |
| yAxisZero | false |
| filled | false |
| Option | Default |
|---|---|
| width | 600 |
| height | 300 |
| barColor | '#000' |
| markerColor | '#000' |
| labelColor | '#000' |
| fontSize | 15 |
| yAxisEnabled | true |
| xAxisEnabled | false |
| yAxisZero | true |
| Option | Default |
|---|---|
| width | 1200 |
| height | 300 |
| barColor | '#000' |
| risingFillColor | '#0D0' |
| fallingFillColor | '#D00' |
| markerColor | '#000' |
| labelColor | '#000' |
| fontSize | 15 |
| yAxisEnabled | true |
| xAxisEnabled | false |
| yAxisZero | false |
Generates clean-looking SVG charts
MIT
chart svg charts