This project is a PHP part for Morris.js ( http://morrisjs.github.io/morris.js/ ).
You can use this PHP class to wrap the Morris Javascript class
- Download Morris Javascript lib from http://morrisjs.github.io/morris.js/
- Include main
morris.php
php file - Include chart base
morris-charts.php
php file - Include all or single chart that you like use
- Use
composer.json
public function draw()
{
?>
<div id="my-charts"></div>
<?php
$morris = new Line( 'my-charts' );
$morris->xkey = array( 'date' );
$morris->ykeys = array( 'value' );
$morris->labels = array( 'Money' );
$morris->data = array(
array( 'date' => '2010', 'value' => 88 ),
array( 'date' => '2011', 'value' => 18 ),
array( 'date' => '2012', 'value' => 28 ),
array( 'date' => '2013', 'value' => 48 ),
);
echo $morris;
}