gfazioli / morris-php

A PHP model and useful class for Morris.js project

Home Page:http://undolog.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Morris PHP v0.6.0

Latest Stable Version Total Downloads Latest Unstable Version License

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

  1. Download Morris Javascript lib from http://morrisjs.github.io/morris.js/
  2. Include main morris.php php file
  3. Include chart base morris-charts.php php file
  4. Include all or single chart that you like use

Getting Started with Composer

  1. 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;
}

About

A PHP model and useful class for Morris.js project

http://undolog.com

License:BSD 2-Clause "Simplified" License


Languages

Language:JavaScript 79.5%Language:PHP 20.5%