2017 © Pedro Peláez
 

library morris-php

WPBones fluent PHP helper classes for morris.js

image

wpbones/morris-php

WPBones fluent PHP helper classes for morris.js

  • Tuesday, March 7, 2017
  • by gfazioli
  • Repository
  • 1 Watchers
  • 0 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

MorrisJS PHP version for WP Bones

[![Latest Stable Version](https://poser.pugx.org/wpbones/morris-php/v/stable?style=for-the-badge)](https://packagist.org/packages/wpbones/morris-php)   [![Latest Unstable Version](https://poser.pugx.org/wpbones/morris-php/v/unstable?style=for-the-badge)](https://packagist.org/packages/wpbones/morris-php)   [![Total Downloads](https://poser.pugx.org/wpbones/morris-php/downloads?style=for-the-badge)](https://packagist.org/packages/wpbones/morris-php)   [![License](https://poser.pugx.org/wpbones/morris-php/license?style=for-the-badge)](https://packagist.org/packages/wpbones/morris-php)   [![Monthly Downloads](https://poser.pugx.org/wpbones/morris-php/d/monthly?style=for-the-badge)](https://packagist.org/packages/wpbones/morris-php)

This package provides a simple way to use the MorrisJS library in your WordPress plugin., (*1)

MorrisJS PHP version for WP Bones, (*2)

Requirements

This package works with a WordPress plugin written with WP Bones framework library., (*3)

Installation

You can install third party packages by using:, (*4)

```sh copy php bones require wpbones/morris-php, (*5)


I advise to use this command instead of `composer require` because doing this an automatic renaming will done. You can use composer to install this package: ```sh copy composer require wpbones/morris-php

You may also to add "wpbones/morris-php": "~0.7" in the composer.json file of your plugin:, (*6)

```json copy filename="composer.json" {4} "require": { "php": ">=7.4.0", "wpbones/wpbones": "~1.5", "wpbones/morris-php": "~1.1" },, (*7)


and run ```sh copy composer install

Enqueue for Controller

You can use the provider to enqueue the styles., (*8)

```php copy use WPKirk\Http\Controllers\Controller; use WPKirk\MorrisPHP\Morris;, (*9)

class MorrisPHPController extends Controller { public function index() {, (*10)

Morris::enqueue();

return WPKirk()
  ->view('packages.morris-php.index')
  ->withAdminStyle('prism')
  ->withAdminScript('prism')
  ->withAdminStyle('wp-kirk-common');

} }, (*11)


In your view: ```php copy filename="your_view.php" copy
<?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 ] ] );

The Versions

07/03 2017

dev-master

9999999-dev https://github.com/wpbones/morris-php

WPBones fluent PHP helper classes for morris.js

  Sources   Download

MIT

The Requires

  • php >=5.2.4

 

php javascript charts morris

07/03 2017

dev-develop

dev-develop https://github.com/wpbones/morris-php

WPBones fluent PHP helper classes for morris.js

  Sources   Download

MIT

The Requires

  • php >=5.2.4

 

php javascript charts morris

07/03 2017

1.0.11

1.0.11.0 https://github.com/wpbones/morris-php

WPBones fluent PHP helper classes for morris.js

  Sources   Download

MIT

The Requires

  • php >=5.2.4

 

php javascript charts morris

07/01 2017

1.0.10

1.0.10.0 https://github.com/wpbones/morris-php

WPBones fluent PHP helper classes for morris.js

  Sources   Download

MIT

The Requires

  • php >=5.2.4

 

php javascript charts morris

14/11 2016

1.0.9

1.0.9.0 https://github.com/wpbones/morris-php

WPBones fluent PHP helper classes for morris.js

  Sources   Download

MIT

The Requires

  • php >=5.2.4

 

php javascript charts morris