Skip to main content

Composer compatible version of JpGraph library with PHP 8.1 support

Submitted by mishutka on

Long story short: https://packagist.org/packages/mitoteam/jpgraph.

We use JpGraph library in several projects. It is looks like abandoned project: almost no updates from maintainers, website and documentation is not updated either. We tried to look for alternative... and there are none! All other charts libraries are either paid ones or have much less functionality. So we stayed with JpGraph.

First problem was composer support. There is 2022 already and all our php dependencies are managed with composer. So we created small wrapper for original JpGraph library with single class for comfortable use of JpGraph library in modern projects. This wrapper is available at https://packagist.org/packages/mitoteam/jpgraph.

Now we upgrading our infrastructure from php 8.0 to 8.1. Everything went fine with Drupal itself and its contrib modules. There were some minor changes in our code (deprecations mostly). But it was a huge amount of warnings in logs about deprecations in JpGraph code. So we had to decide either to stay at php 8.0 or try to patch JpGraph library to be compatible with php 8.1. And we did it! We managed to get rid of all the deprecation warnings from JpGraph.

So we can declare php 8.1 support for our JpGraph wrapper at https://packagist.org/packages/mitoteam/jpgraph now.