GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - wpbones/morris-php

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

MorrisJS PHP version for WP Bones

Latest Stable Version   Total Downloads   License   Monthly Downloads

morris-php at a glance, refreshed daily: commits, releases, stars, issues and pull requests, a year of commit activity, the weekly rhythm, languages, latest commits and releases, contributors
Made with glancecard · refreshed daily

This package provides a simple way to use the MorrisJS library in your WordPress plugin.

MorrisJS PHP version for WP Bones

Requirements

This package works with a WordPress plugin written with WP Bones framework library.

Installation

You can install third party packages by using:

php bones require wpbones/morris-php

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:

composer require wpbones/morris-php

You may also to add "wpbones/morris-php": "^1.0" in the composer.json file of your plugin:

  "require": {
    "php": ">=8.1",
    "wpbones/wpbones": "^3.0",
    "wpbones/morris-php": "^1.0"
  },

and run

composer install

Enqueue for Controller

You can use the provider to enqueue the styles.

use WPKirk\Http\Controllers\Controller;
use WPKirk\MorrisPHP\Morris;

class MorrisPHPController extends Controller
{
  public function index()
  {

    Morris::enqueue();

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

In your view:

<div id="morris-area"></div>

<?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 ]
                   ] );

About

No description or website provided.

Topics

charting-librarychartsmorrismorris-javascriptmorris-phpwordpresswp-boneswp-bones-packages

Resources

Readme
BSD-2-Clause license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.