gfazioli / morris-php
PHP helper classes for morris.js
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 6
Forks: 5
Open Issues: 0
Language:JavaScript
Requires
- php: >=5.2.4
- morrisjs/morris.js: dev-master
This package is auto-updated.
Last update: 2024-11-20 05:40:30 UTC
README
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
Getting Started
- 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
Getting Started with Composer
- Use
composer.json
Examples
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; }