2017 © Pedro Peláez
 

library laravel-morris-php

Laravel Service Provider for morris.js

image

gfazioli/laravel-morris-php

Laravel Service Provider for morris.js

  • Monday, March 6, 2017
  • by gfazioli
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,294 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 12 % Grown

The README.md

Laravel Morris PHP

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Laravel Morris PHP is the version for Laravel of MorrisPHP With this Service Provider, you can draw amazing char by usign Morris.js., (*2)

Requirements

  • PHP 5.5.9 or greater
  • Laravel 5.4 or greater

Installation

composer require gfazioli/laravel-morris-php

Laravel

We include service providers and a facade for easy integration and a nice syntax for Laravel., (*3)

Firstly, add the gfazioli\Morris\MorrisServiceProvider provider to the providers array in config/app.php, (*4)

'providers' => [
  ...
  gfazioli\Morris\MorrisServiceProvider::class,
],

and then add the facade to your aliases array, (*5)

'aliases' => [
  ...
  'Morris' => gfazioli\Morris\Facades\MorrisFacade::class,
],

HTML

Remember to include the following Javascript and styles before use Morris., (*6)

  <!-- Morris -->
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
  <script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>

Examples




<?php echo Morris::area( 'morris-area' ) ->xkey( [ 'y' ] ) ->ykeys( [ 'a', 'b' ] ) ->labels( [ 'Series A', 'Series B' ] ) ->hoverCallback( 'function(index, options, content){var row = options.data[index];return "sin(" + row.x + ") = " + row.y;}' ) ->data( [ [ "y" => '2006', "a" => 100, "b" => 90 ], [ "y" => '2007', "a" => 75, "b" => 65 ], [ "y" => '2008', "a" => 50, "b" => 40 ], [ "y" => '2009', "a" => 75, "b" => 65 ], [ "y" => '2010', "a" => 50, "b" => 40 ], [ "y" => '2011', "a" => 75, "b" => 65 ], [ "y" => '2012', "a" => 100, "b" => 90 ] ] );



<?php echo Morris::bar( 'morris-bar' ) ->xkey( [ 'y' ] ) ->ykeys( [ 'a', 'b' ] ) ->labels( [ 'Series A', 'Series B' ] ) ->data( [ [ "y" => '2006', "a" => 100, "b" => 90 ], [ "y" => '2007', "a" => 75, "b" => 65 ], [ "y" => '2008', "a" => 50, "b" => 40 ], [ "y" => '2009', "a" => 75, "b" => 65 ], [ "y" => '2010', "a" => 50, "b" => 40 ], [ "y" => '2011', "a" => 75, "b" => 65 ], [ "y" => '2012', "a" => 100, "b" => 90 ] ] );



<?php echo Morris::donut( 'morris-donut' ) ->data( [ [ "label" => "Download Sales", "value" => 12 ], [ "label" => "In-Store Sales", "value" => 30 ], [ "label" => "Mail-Order Sales", "value" => 20 ] ] );



<?php echo Morris::line( 'morris-line' ) ->xkey( [ 'date' ] ) ->ykeys( [ 'value' ] ) ->labels( [ 'Money' ] ) ->data( [ [ 'date' => '2010', 'value' => 88 ], [ 'date' => '2011', 'value' => 18 ], [ 'date' => '2012', 'value' => 28 ], [ 'date' => '2013', 'value' => 48 ], ] );

The Versions

06/03 2017

dev-master

9999999-dev https://github.com/gfazioli/laravel-morris-php

Laravel Service Provider for morris.js

  Sources   Download

MIT

The Requires

 

php javascript charts morris

06/03 2017

dev-develop

dev-develop https://github.com/gfazioli/laravel-morris-php

Laravel Service Provider for morris.js

  Sources   Download

MIT

The Requires

 

php javascript charts morris

06/03 2017

1.0.4

1.0.4.0 https://github.com/gfazioli/laravel-morris-php

Laravel Service Provider for morris.js

  Sources   Download

MIT

The Requires

 

php javascript charts morris

22/12 2016

1.0.3

1.0.3.0 https://github.com/gfazioli/laravel-morris-php

Laravel Service Provider for morris.js

  Sources   Download

MIT

The Requires

 

php javascript charts morris

19/10 2016

1.0.2

1.0.2.0 https://github.com/gfazioli/laravel-morris-php

Laravel Service Provider for morris.js

  Sources   Download

MIT

The Requires

 

php javascript charts morris

19/10 2016

1.0.1

1.0.1.0 https://github.com/gfazioli/laravel-morris-php

Laravel Service Provider for morris.js

  Sources   Download

MIT

The Requires

 

php javascript charts morris

19/10 2016

1.0.0

1.0.0.0 https://github.com/gfazioli/laravel-morris-php

Laravel Service Provider for morris.js

  Sources   Download

MIT

The Requires

 

php javascript charts morris