PHPackages                             mitoteam/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mitoteam/jpgraph

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mitoteam/jpgraph
================

JpGraph library composer package with PHP 8.5 support

10.5.2(5mo ago)55613.7k—5.8%7[2 issues](https://github.com/mitoteam/jpgraph/issues)7QPL-1.0PHPPHP &gt;=5.5

Since Jan 16Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/mitoteam/jpgraph)[ Packagist](https://packagist.org/packages/mitoteam/jpgraph)[ Docs](https://github.com/mitoteam/jpgraph)[ RSS](/packages/mitoteam-jpgraph/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (35)Used By (7)

JpGraph library composer package with PHP 8.5 support
=====================================================

[](#jpgraph-library-composer-package-with-php-85-support)

[![Packagist Version](https://camo.githubusercontent.com/3c6e84175e69099fbcad573324feb372bdcfadd0777abc74a0c87b88477989f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d69746f7465616d2f6a7067726170683f696e636c7564655f70726572656c6561736573267374796c653d666c61742d737175617265266c6f676f3d7061636b6167697374)](https://packagist.org/packages/mitoteam/jpgraph)[![Packagist PHP Version Support](https://camo.githubusercontent.com/d016200c419a7354f1b8bf5fe32b2a439d55e9523f8d1cc20c8e99735cacb3ab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://github.com/mitoteam/jpgraph)[![Packagist Total Downloads](https://camo.githubusercontent.com/a977222c65be4d79f466ae45d95309aa62eaed3de8625f7d106c32eaee6132bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mitoteam/jpgraph/stats)[![Packagist Monthly Downloads](https://camo.githubusercontent.com/224c602e0507a136914bcfbbc114a7954af4ec2280d9d3e58805f59f9e46cc3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mitoteam/jpgraph/stats)

[![GitHub Version](https://camo.githubusercontent.com/578c89291f8a7c3366a0b94bed09e9a98a8049549b706f9afd8aa3663ee28ea0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265266c6f676f3d676974687562)](https://github.com/mitoteam/jpgraph)[![GitHub Release Date](https://camo.githubusercontent.com/5b61cd11abe21082fd3778d6dca8f2bff5560194ae53af34b1d424831939ba70/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265)](https://github.com/mitoteam/jpgraph/releases)[![GitHub code size in bytes](https://camo.githubusercontent.com/dc6b5056979e12067271c2030dfbf13e9e6bf18cbe3141772d4a5a3a05938ced/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/dc6b5056979e12067271c2030dfbf13e9e6bf18cbe3141772d4a5a3a05938ced/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265)[![GitHub contributors](https://camo.githubusercontent.com/c7787d73367d965a7d73fbe6c0a02cd23a88baad8a7f9a8125643f1c416e7194/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732d616e6f6e2f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265)](https://github.com/mitoteam/jpgraph/graphs/contributors)[![GitHub commit activity](https://camo.githubusercontent.com/6bf6c2558c35a7997b6bb9ad071230804732812e9f6911879afe848dfe80fcbf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d69742d61637469766974792f792f6d69746f7465616d2f6a7067726170683f7374796c653d666c61742d737175617265)](https://github.com/mitoteam/jpgraph/commits)

JpGraph library version: **4.4.3**

PHP versions support: from 5.5 to **8.5**. [Original notes](https://jpgraph.net/download/manuals/chunkhtml/ch01s05.html) about PHP versions.

Usage with composer
-------------------

[](#usage-with-composer)

This package is a helper to load original JpGraph library after declaring it as your dependency in composer.json:

```
composer require mitoteam/jpgraph

```

Then you can load library from anywhere in your code:

```
use mitoteam\jpgraph\MtJpGraph;

// load library and modules
MtJpGraph::load();                # not really useful without modules
//or
MtJpGraph::load('bar');           # load with single module
//or
MtJpGraph::load(['bar', 'line']); # load with several modules
//or
MtJpGraph::load(['bar', 'line'], true); # load with several modules in Extended Mode (see below)

//using original JpGraph classes
$graph = new Graph(200, 300);
```

You can call `MtJpGraph::load()` method as many times as you need everywhere in your code. Internally it checks if library or module was already loaded and does not load it another time.

Usage without composer
----------------------

[](#usage-without-composer)

Download latest version archive from [Releases](https://github.com/mitoteam/jpgraph/releases) page and unpack it.

Version numbers
---------------

[](#version-numbers)

We started with version *4.3.5* as latest available library version in time we started. But we need to make some patches to original library (for example to support latest PHP versions). So we had to switch to own version numbers to be able to release updates.

At 2022-02-25 we decided to switch to version number **10.0.0** to leave some margin in numbering from original library v4.3.5.

Current version numbers:

- **Version 10.x** of this package is the latest version of JpGraph library with php **8.2-8.5** compatibility patches (code in "main" branch). Can be loaded in Extended Mode (see below).
- **Version 4.x** of this package provides latest version of original JpGraph library as-is without any compatibility patches (code in "original" branch).

All changes to the original library can be examined as [difference between **main** and **original** branches](https://github.com/mitoteam/jpgraph/compare/original..main#files_bucket).

Overriding jpgraph's settings
-----------------------------

[](#overriding-jpgraphs-settings)

A lot of original jpgraph's settings are defined as constants in `jpg-config.inc.php` and `jpgraph_ttf.inc.php` files. We wrapped all these constants definitions with `if(!defined())` checks. So you can define them with required values **before** loading MtJpGraph. See [Issue #24](https://github.com/mitoteam/jpgraph/issues/24) for the details.

Code example:

```
use mitoteam\jpgraph\MtJpGraph;

//first define required constants
define('CACHE_FILE_GROUP', 'supergroup');

// and then load library and modules
MtJpGraph::load('bar');
```

Extended Mode
-------------

[](#extended-mode)

We started with just patches for compatibility with recent PHP versions. Before version 10.3 there were no any changes to original code except adding some typecasting or declaring some class members explicitly.

But after library was used wider there were some bugs discovered in original code. We aware to change functionality of the original library so **Extended Mode** was introduced in version **10.3.0**. Now you can pass `true` as second argument to `MtJpGraph::load()` method to enable Extended Mode. This will enable several more patches to the original code to overcome some bugs.

Extended Mode is disabled by default, you can enable it explicitly only.

### Custom exception handler

[](#custom-exception-handler)

jpgraph sets custom exceptions handler internally to be able to draw error message in picture if some exception pops up. It restores old exception handler if any was set after exception processing. This behavior can interfere with some tests runners which are using own exception handlers. For example [phpunit](https://github.com/sebastianbergmann/phpunit) marks tests as *risky* with message "Test code or tested code did not remove its own exception handlers".

It is possible to disable custom jpgraph's exceptions handler by calling explicitly `MtJpGraph::setSkipExceptionHandler(true);` before first call to `MtJpGraph::load()`. MtJpGraph checks if `PHPUNIT_COMPOSER_INSTALL` constant defined and disables jpgraph's exceptions handler implicitly for phpunit.

**Please note**: this intended to be used in tests context only and should not be used in production mode.

Links
-----

[](#links)

- Original JpGraph website:
- Documentation:
- Examples:

Star History
------------

[](#star-history)

[![Star History Chart](https://camo.githubusercontent.com/eabff8462d12b30e841fac7904b20e72ac4f518faf550bf603a16598d58b7386/68747470733a2f2f6170692e737461722d686973746f72792e636f6d2f7376673f7265706f733d6d69746f7465616d2f6a70677261706826747970653d44617465)](https://star-history.com/#mitoteam/jpgraph&Date)

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance81

Actively maintained with recent releases

Popularity51

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99% 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 ~44 days

Recently: every ~93 days

Total

33

Last Release

161d ago

Major Versions

4.3.5 → 10.0.02022-02-25

4.4.0 → 10.1.02022-04-21

4.4.1 → 10.1.12022-05-13

v4.4.2 → v10.3.22023-08-09

PHP version history (3 changes)10.0.0PHP &gt;=5.5 &lt;=8.1

10.0.3.1PHP &gt;=5.5

10.2.1-rcPHP &gt;=5.5 &lt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/9feed51e3e8721770ad2e76ba32834efe5504622c974e398e0ee2725b7bd0259?d=identicon)[f1mishutka](/maintainers/f1mishutka)

---

Top Contributors

[![f1mishutka](https://avatars.githubusercontent.com/u/24731190?v=4)](https://github.com/f1mishutka "f1mishutka (99 commits)")[![Pryx](https://avatars.githubusercontent.com/u/5222912?v=4)](https://github.com/Pryx "Pryx (1 commits)")

---

Tags

composer-packagejpgraphphpjpgraph

### Embed Badge

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

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

###  Alternatives

[amenadiel/jpgraph

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

1492.2M7](/packages/amenadiel-jpgraph)[philipnewcomer/acf-unique-id-field

An ACF field which generates a unique ID value, intended for use in ACF Repeaters

4726.7k](/packages/philipnewcomer-acf-unique-id-field)[yeesoft/yii2-comments

Comments Module For Yii2 Framework

227.8k2](/packages/yeesoft-yii2-comments)

PHPackages © 2026

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