2017 © Pedro Pelรกez
 

library jpgraph

jpGraph, library to make graphs and charts

image

amenadiel/jpgraph

jpGraph, library to make graphs and charts

  • Wednesday, June 13, 2018
  • by amenadiel
  • Repository
  • 14 Watchers
  • 30 Stars
  • 105,593 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 20 Forks
  • 0 Open issues
  • 19 Versions
  • 42 % Grown

The README.md

JpGraph Community Edition v4.1.0

, (*1)

JpGraph Community Edition was created as a Composer friendly port of JpGraph v3.5. With time and through incremental refactorings, it became a whole different library, with PSR-1 and PSR-2 compliant codebase, namespaces and folder hierarchy enabling PSR-4 autoloading, and more., (*2)

We are now, at most, distant cousins with the current official release., (*3)

Refactoring is an ongoing effort and we ensure editions and additions don't hurt our (already poor) metrics, (*4)

Scrutinizer Code Quality , (*5)


What is JPGraph Community Edition?

As can be seen in their releases section, there was a six year pause in JPGraph release cycle, during which some of us had no choice but to code our way out of PHP 5.x. And thus "Community Edition" was born. From then on, this library evolved on its own and completely diverged from the official packages., (*6)

In general terms, JPGraph CE relies in PHP's thriving ecosystem. We aim to be a simple dependency you can seamlessly integrate in your app. JPGraph CE aligns with PHP Standards Reccomendations as published by the PHP Framework Interoperability Group, and when presented with the choice, will always pick an agnostic implementation over custom ones that reinvent the wheel. A lot of code has been trimmed and refactored with this purpose and a lot more is waiting to undergo such a change., (*7)

  • Distrbution through PHP's popular Packagist Registry
  • Relies in Composer, so you don't need to manually download or copy anything, nor check for platform and dependency requirements yourself.
  • PSR-4: Autoloader compliant structure. No need to resort to require or include in your code.
  • Sensible fallbacks to handle missing fonts or particular GD version features availability.
  • IDE friendly, allowing for autocompletion and go-to-definition where supported.
  • Integration pipelines checking new releases compatibility against different PHP versions
  • New or refactored code is expected to observe PSR-1 and PSR-2 coding standards (Eventually PSR-12 as well).

Comparing against the original v3.5 codebase, we also stripped examples or incomplete implementation of graph types exclusive to v3.5 pro (e.g. Barcodes)., (*8)

Things that JPGraph CE is NOT

  • This library is NOT an official JPGraph package. The offcial package can be downloaded at JPGraph's downloads section of their website. They have a full featured free version with support for current and olver PHP versions.
  • Endorsed in any way by JPGraph's creator company Asial
  • A composer enabled wrapper for the official package
  • A drop-in replacement for the official package. We do not claim nor offer any kind of feature parity with the official package.

Requirements And Installation

This version requires PHP v7.2.0+. If you need to install this library package in older PHP environments please try, (*9)

  • Upgrading your PHP installation. (No, really, even PHP 7.2 is past its EOL)
  • for PHP v7.0+ please try release v4.0.x
  • for PHP v5.6+ please check release v3.6.x

Install it Using composer, (*10)

composer require amenadiel/jpgraph:^4

How to use

See the examples folder for working samples., (*11)

The examples work the same way you should use this library:, (*12)

  • run composer install, (*13)

  • require vendor/autoload.php it the top of your script, (*14)

  • generate a graph with a snippet like the following, (*15)

   require_once 'PATH/TO/vendor/autoload.php';

   use Amenadiel\JpGraph\Graph;
   use Amenadiel\JpGraph\Plot;

   // Create the Pie Graph.
   $graph = new Graph\PieGraph(350, 250);
   $graph->title->Set("A Simple Pie Plot");
   $graph->SetBox(true);

   $data = array(40, 21, 17, 14, 23);
   $p1   = new Plot\PiePlot($data);
   $p1->ShowBorder();
   $p1->SetColor('black');
   $p1->SetSliceColors(array('#1E90FF', '#2E8B57', '#ADFF2F', '#DC143C', '#BA55D3'));

   $graph->Add($p1);
   $graph->Stroke();
  • important make sure to instance the Graph (or Graph child class) before its content (for example, Plots). Doing this will load the global configuration to the global scope. Yeah, we know we are polluting the global scope with dozens of constants, but we are still refactoring :shrug: .

See the examples working by performing the following steps:, (*16)

  • run composer install
  • run make start or php -S localhost:8000 -t Examples
  • Open your browser at http://localhost:8000

Change the config

You can override some configs set on config.inc.php by creating a .env file in your project root. See .env.example as a reference., (*17)

Contributors โœจ

All Contributors , (*18)

Thanks goes to these wonderful people (emoji key):, (*19)

, (*20)


Sean Zhang

๐Ÿ’ป

Shawn McCool

๐Ÿ’ป

Vinicius Dias

๐Ÿ’ป

Paul van der Knaap

๐Ÿ’ป

Florent Morselli

๐Ÿ’ป

Tony Murray

๐Ÿ’ป

Andreas

๐Ÿ’ป

Corey Watts

๐Ÿ’ป

Alexander Rakushin

๐Ÿ’ป

Muhammad Abid

๐Ÿ’ป

WhileTrue

๐Ÿ›

, (*21)

This project follows the all-contributors specification. Contributions of any kind welcome!, (*22)


Wishlist

  • Get all the examples working (half of them have yet to be transformed from the old code to the new PSR-4 format)
  • Add more tests (We need to test more classes and methods besides the ones in the examples, as well as perform more assetions on the current tests)
  • Add alternative use of imagick

jpgraph_logo, (*23)

Similar Projects

License

FOSSA Status, (*24)

The Versions

13/06 2018

dev-master

9999999-dev http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0 QPL-1.0

The Requires

 

The Development Requires

chart data graph pie jpgraph

13/06 2018

3.6.20

3.6.20.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL-1.0

The Requires

 

The Development Requires

chart data graph pie jpgraph

18/05 2018

3.6.19

3.6.19.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL-1.0

The Requires

 

The Development Requires

chart data graph pie jpgraph

18/05 2018

3.6.18

3.6.18.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL-1.0

The Requires

 

The Development Requires

chart data graph pie jpgraph

16/05 2018

3.6.17

3.6.17.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL-1.0

The Requires

 

The Development Requires

chart data graph pie jpgraph

09/05 2018

3.6.16

3.6.16.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL-1.0

The Requires

 

The Development Requires

chart data graph pie jpgraph

13/02 2018

3.6.14

3.6.14.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL-1.0

The Requires

  • php >=5.4.0
  • ext-gd *

 

chart data graph pie jpgraph

13/02 2018

3.6.13

3.6.13.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL-1.0

The Requires

  • php >=5.4.0
  • ext-gd *

 

chart data graph pie jpgraph

14/12 2017

3.6.12

3.6.12.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.4.0
  • ext-gd *

 

chart data graph pie jpgraph

22/02 2017

3.6.11

3.6.11.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.4.0
  • ext-gd *

 

chart data graph pie jpgraph

01/02 2017

3.6.10

3.6.10.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.4.0
  • ext-gd *

 

chart data graph pie jpgraph

02/09 2016

3.6.8

3.6.8.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.4.0
  • ext-gd *

 

chart data graph pie jpgraph

10/06 2016

3.6.7

3.6.7.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.4.0
  • ext-gd *

 

chart data graph pie jpgraph

11/03 2016

3.6.6

3.6.6.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.3.0
  • ext-gd *

 

chart data graph pie jpgraph

29/02 2016

v3.6.5

3.6.5.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.3.0
  • ext-gd *

 

chart data graph pie jpgraph

15/10 2015

v3.6.4

3.6.4.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.3.0
  • ext-gd *

 

chart data graph pie jpgraph

26/09 2015

v3.6.3

3.6.3.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.3.0
  • ext-gd *

 

chart data graph pie jpgraph

27/07 2015

v3.6.2

3.6.2.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.3.0
  • ext-gd *

 

chart data graph pie jpgraph

27/07 2015

3.6.0

3.6.0.0 http://jpgraph.net/

jpGraph, library to make graphs and charts

  Sources   Download

QPL 1.0

The Requires

  • php >=5.3.0
  • ext-gd *

 

chart data graph pie jpgraph