PHPackages                             naas/jpgraph - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. naas/jpgraph

ActiveLibrary[Image &amp; Media](/categories/media)

naas/jpgraph
============

Composer Friendly, full refactor of JpGraph, library to make graphs and charts

1.0.2(1y ago)01.5k↓50%QPL-1.0PHPPHP &gt;=7.2.0

Since Jan 13Pushed 1y agoCompare

[ Source](https://github.com/nunoarmando/jpgraph)[ Packagist](https://packagist.org/packages/naas/jpgraph)[ Docs](http://jpgraph.net/)[ RSS](/packages/naas-jpgraph/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (11)Versions (4)Used By (0)

JpGraph Community Edition v4.1.0
================================

[](#jpgraph-community-edition-v410)

[![](https://camo.githubusercontent.com/5c5439e434c0baab6818406435e847da007077c845dfbf8bf83bbe19c72b1526/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6161732f6a706772617068)](https://packagist.org/packages/naas/jpgraph)[![](https://camo.githubusercontent.com/10e59292e40a056a2f4341e1efe7a890d405542017c0e7ff044393737d0ca295/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e6161732f6a7067726170682e737667)](https://packagist.org/packages/naas/jpgraph)[![](https://camo.githubusercontent.com/72599b40b7ce48454497877d54c0d4f9f62f9bb062ecfa5b23014589e59982d3/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246487561736f466f756e64726965732532466a7067726170682e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2FHuasoFoundries%2Fjpgraph?ref=badge_shield)[![](https://github.com/HuasoFoundries/jpgraph/actions/workflows/tests.yml/badge.svg)](https://github.com/HuasoFoundries/jpgraph/actions/workflows/tests.yml)

**JpGraph Community Edition** was created as a [Composer](https://getcomposer.org/) friendly port of [JpGraph v3.5](README.3.5.md). With time and through incremental refactorings, it became a whole different library, with [PSR-1](https://www.php-fig.org/psr/psr-1/) and [PSR-2](https://www.php-fig.org/psr/psr-2/) compliant codebase, namespaces and folder hierarchy enabling [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloading, and more.

We are now, at most, distant cousins with the current official release.

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

[![](https://camo.githubusercontent.com/6ccac5e94ab1411a474d23d5175b2fa506dae278aa3f0e2a8b375aeded4171b0/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f66383562393165396138356562346234333035392f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/HuasoFoundries/jpgraph/maintainability) [![](https://camo.githubusercontent.com/e024f3ac7166071a623a497036e5a4d9e34541d44b55bdb98a88b37537c618a5/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6562323961656232393865613433373961323831646233356435356464656231)](https://www.codacy.com/gh/HuasoFoundries/jpgraph/dashboard?utm_source=github.com&utm_medium=referral&utm_content=HuasoFoundries/jpgraph&utm_campaign=Badge_Grade)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/af767938412fc574eed68a8f7b94d441d5c27ca6ada1c00664ef70957093f2ee/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f487561736f466f756e64726965732f6a7067726170682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/HuasoFoundries/jpgraph/?branch=master) [ ![](https://camo.githubusercontent.com/a13018df2ad6abf8a35414e557a0b9d0140d064aea0f3588f87d7a022a2934c4/68747470733a2f2f636f6465636f762e696f2f67682f487561736f466f756e64726965732f6a7067726170682f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d564553624d5632725334) ](https://codecov.io/gh/HuasoFoundries/jpgraph)

---

What is JPGraph Community Edition?
----------------------------------

[](#what-is-jpgraph-community-edition)

As can be seen in [their releases section](https://jpgraph.net/download/release.php), 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.

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](https://www.php-fig.org/psr/) as published by the [PHP Framework Interoperability Group](https://www.php-fig.org/), 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.

- Distrbution through PHP's popular [Packagist Registry](https://packagist.org/packages/naas/jpgraph)
- Relies in [Composer](https://getcomposer.org/), so you don't need to manually download or copy anything, nor check for platform and dependency requirements yourself.
- [PSR-4: Autoloader](https://www.php-fig.org/psr/psr-4/) 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](https://github.com/HuasoFoundries/jpgraph/actions/workflows/tests.yml) checking new releases compatibility against different PHP versions
- New or refactored code is expected to observe [PSR-1](https://www.php-fig.org/psr/psr-1/) and [PSR-2](https://www.php-fig.org/psr/psr-2/) coding standards (Eventually [PSR-12](https://www.php-fig.org/psr/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).

### Things that JPGraph CE is NOT

[](#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](https://jpgraph.net/download/). 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](https://www.asial.co.jp/)
- 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
-----------------------------

[](#requirements-and-installation)

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

- Upgrading your PHP installation. (No, really, even PHP 7.2 is past its EOL)
- for PHP v7.0+ please try [release v4.0.x](https://github.com/HuasoFoundries/jpgraph/releases/tag/v4.0.3)
- for PHP v5.6+ please check [release v3.6.x](https://github.com/HuasoFoundries/jpgraph/tree/v3.6.21)

Install it Using composer

```
composer require naas/jpgraph:^4
```

How to use
----------

[](#how-to-use)

See the [examples folder](https://github.com/naas/jpgraph/tree/master/Examples) for working samples.

The examples work the same way you should use this library:

- run `composer install`
- require `vendor/autoload.php` it the top of your script
- generate a graph with a snippet like the following

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

   use naas\JpGraph\Graph;
   use naas\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 🤷 .

See the examples working by performing the following steps:

- run `composer install`
- run `make start` **or** `php -S localhost:8000 -t Examples`
- Open your browser at

### Change the config

[](#change-the-config)

You can override some configs set on [config.inc.php](src/config.inc.php) by creating a `.env` file in your project root. See [.env.example](.env.example) as a reference.

Contributors ✨
==============

[](#contributors-)

[![All Contributors](https://camo.githubusercontent.com/736decdff0bd6d69d305f31c6e893f012ce8beccc897a6ce790171508004cb2c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616c6c5f636f6e7472696275746f72732d31312d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](#contributors-)

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

  [![](https://avatars.githubusercontent.com/u/2536402?v=4?s=50)
**Sean Zhang**](https://github.com/zhangsean)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=zhangsean "Code") [![](https://avatars.githubusercontent.com/u/560749?v=4?s=50)
**Shawn McCool**](http://shawnmc.cool)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=ShawnMcCool "Code") [![](https://avatars.githubusercontent.com/u/6991415?v=4?s=50)
**Vinicius Dias**](https://youtube.com/c/DiasDeDev?sub_confirmation=1)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=CViniciusSDias "Code") [![](https://avatars.githubusercontent.com/u/5946360?v=4?s=50)
**Paul van der Knaap**](https://github.com/PauluzzNL)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=PauluzzNL "Code") [![](https://avatars.githubusercontent.com/u/1091072?v=4?s=50)
**Florent Morselli**](https://morselli.fr)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=Spomky "Code") [![](https://avatars.githubusercontent.com/u/39462?v=4?s=50)
**Tony Murray**](https://github.com/murrant)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=murrant "Code") [![](https://avatars.githubusercontent.com/u/973653?v=4?s=50)
**Andreas**](https://incoherent.ch)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=iquito "Code")   [![](https://avatars.githubusercontent.com/u/220260?v=4?s=50)
**Corey Watts**](https://corwatts.com)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=CorWatts "Code") [![](https://avatars.githubusercontent.com/u/9015003?v=4?s=50)
**Alexander Rakushin**](https://github.com/eisberg)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=eisberg "Code") [![](https://avatars.githubusercontent.com/u/20839618?v=4?s=50)
**Muhammad Abid**](https://github.com/abidaks)
[💻](https://github.com/HuasoFoundries/jpgraph/commits?author=abidaks "Code") [![](https://avatars.githubusercontent.com/u/683688?v=4?s=50)
**WhileTrue**](http://www.whiletrue.it)
[🐛](https://github.com/HuasoFoundries/jpgraph/issues?q=author%3Aformikaio "Bug reports") This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

---

### Wishlist

[](#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](http://php.net/manual/en/imagick.setup.php)

[![jpgraph_logo](https://raw.githubusercontent.com/HuasoFoundries/jpgraph/master/jpgraph_logo.jpg)](https://raw.githubusercontent.com/HuasoFoundries/jpgraph/master/jpgraph_logo.jpg)

Similar Projects
----------------

[](#similar-projects)

- [ztec/JpGraph](https://github.com/ztec/JpGraph)

License
-------

[](#license)

[![FOSSA Status](https://camo.githubusercontent.com/222503bdb8cb3cb2209fea8a838f3e1c5956be9fcc26ec2f9d3b217245380bf9/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246487561736f466f756e64726965732532466a7067726170682e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2FHuasoFoundries%2Fjpgraph?ref=badge_large)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance41

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 79.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

490d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/238df8531051c7da3e5fc9d6a254fb0ddf3d9a2b8a5694b1a525152f34afe208?d=identicon)[naas](/maintainers/naas)

---

Top Contributors

[![ffflabs](https://avatars.githubusercontent.com/u/238439?v=4)](https://github.com/ffflabs "ffflabs (225 commits)")[![allcontributors[bot]](https://avatars.githubusercontent.com/in/23186?v=4)](https://github.com/allcontributors[bot] "allcontributors[bot] (22 commits)")[![jeeinn](https://avatars.githubusercontent.com/u/13930054?v=4)](https://github.com/jeeinn "jeeinn (4 commits)")[![Spomky](https://avatars.githubusercontent.com/u/1091072?v=4)](https://github.com/Spomky "Spomky (4 commits)")[![iquito](https://avatars.githubusercontent.com/u/973653?v=4)](https://github.com/iquito "iquito (3 commits)")[![CorWatts](https://avatars.githubusercontent.com/u/220260?v=4)](https://github.com/CorWatts "CorWatts (2 commits)")[![zhangsean](https://avatars.githubusercontent.com/u/2536402?v=4)](https://github.com/zhangsean "zhangsean (2 commits)")[![diegomarty](https://avatars.githubusercontent.com/u/11429554?v=4)](https://github.com/diegomarty "diegomarty (2 commits)")[![MoT3rror](https://avatars.githubusercontent.com/u/5009981?v=4)](https://github.com/MoT3rror "MoT3rror (2 commits)")[![eisberg](https://avatars.githubusercontent.com/u/9015003?v=4)](https://github.com/eisberg "eisberg (2 commits)")[![nunoarmando](https://avatars.githubusercontent.com/u/16233525?v=4)](https://github.com/nunoarmando "nunoarmando (2 commits)")[![qav-nuno-serrano](https://avatars.githubusercontent.com/u/164892257?v=4)](https://github.com/qav-nuno-serrano "qav-nuno-serrano (1 commits)")[![funkjedi](https://avatars.githubusercontent.com/u/9314?v=4)](https://github.com/funkjedi "funkjedi (1 commits)")[![angeljqv](https://avatars.githubusercontent.com/u/79208641?v=4)](https://github.com/angeljqv "angeljqv (1 commits)")[![asterion](https://avatars.githubusercontent.com/u/194420?v=4)](https://github.com/asterion "asterion (1 commits)")[![CViniciusSDias](https://avatars.githubusercontent.com/u/6991415?v=4)](https://github.com/CViniciusSDias "CViniciusSDias (1 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")[![abidaks](https://avatars.githubusercontent.com/u/20839618?v=4)](https://github.com/abidaks "abidaks (1 commits)")[![kick-the-bucket](https://avatars.githubusercontent.com/u/7068596?v=4)](https://github.com/kick-the-bucket "kick-the-bucket (1 commits)")

---

Tags

datachartgraphpiejpgraph

###  Code Quality

TestsCodeception

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/naas-jpgraph/health.svg)

```
[![Health](https://phpackages.com/badges/naas-jpgraph/health.svg)](https://phpackages.com/packages/naas-jpgraph)
```

###  Alternatives

[amenadiel/jpgraph

Composer Friendly, full refactor of JpGraph, library to make graphs and charts

1492.2M7](/packages/amenadiel-jpgraph)[samchristy/piechart

A simple class for drawing pie charts with ImageMagick or GD in PHP.

3347.4k1](/packages/samchristy-piechart)[alimranahmed/laraocr

Laravel Optical Character Reader(OCR) package using different OCR engines like Tesseract

17081.9k](/packages/alimranahmed-laraocr)[ianw/quickchart

QuickChart chart API

46638.6k](/packages/ianw-quickchart)[gregwar/gnuplot

GnuPlot library

299.7k](/packages/gregwar-gnuplot)[ottaviano/faker-gravatar

Faker Gravatar image provider

1055.7k6](/packages/ottaviano-faker-gravatar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
