Skip to content

Commit

Permalink
Upgrade mitoteam/jpgraph (#3603)
Browse files Browse the repository at this point in the history
They have made some changes at my request, the major effect of which is that it will now work with 33_Chart_create_bar_stacked. This is a departure for them in that they have changed the functionality of jpgraph, not merely made sure that it is compatible with new Php releases.
  • Loading branch information
oleibman authored Jun 2, 2023
1 parent 9b9e30c commit 3aab263
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ or the appropriate PDF Writer wrapper for the library that you have chosen to in
For Chart export, we support following packages, which you will also need to install yourself using `composer require`
- [jpgraph/jpgraph](https://packagist.org/packages/jpgraph/jpgraph) (this package was abandoned at version 4.0.
You can manually download the latest version that supports PHP 8 and above from [jpgraph.net](https://jpgraph.net/))
- [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) - fork with modern PHP versions support.
- [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) - up to date fork with modern PHP versions support and some bugs fixed.

and then configure PhpSpreadsheet using:
```php
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^1.0 || ^2.0",
"friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "^10.2.4",
"mitoteam/jpgraph": "^10.3",
"mpdf/mpdf": "^8.1.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.1",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions samples/Chart/35_Chart_render33.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
$unresolvedErrors = [];
} else {
$unresolvedErrors = [
// The following spreadsheet was created by 3rd party software,
// and doesn't include the data that usually accompanies a chart.
// That is good enough for Excel, but not for JpGraph.
'33_Chart_create_bar_stacked.xlsx',
//'33_Chart_create_bar_stacked.xlsx', // fixed with mitoteam/jpgraph 10.3
];
}
foreach ($inputFileNames as $inputFileName) {
Expand Down
6 changes: 3 additions & 3 deletions src/PhpSpreadsheet/Chart/Renderer/MtJpGraphRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace PhpOffice\PhpSpreadsheet\Chart\Renderer;

/**
* Jpgraph is not oficially maintained in Composer.
* Jpgraph is not officially maintained by Composer at packagist.org.
*
* This renderer implementation uses package
* https://packagist.org/packages/mitoteam/jpgraph
*
* This package is up to date for August 2022 and has PHP 8.1 support.
* This package is up to date for June 2023 and has PHP 8.2 support.
*/
class MtJpGraphRenderer extends JpGraphRendererBase
{
Expand All @@ -29,7 +29,7 @@ protected static function init(): void
'regstat',
'scatter',
'stock',
]);
], true); // enable Extended mode

$loaded = true;
}
Expand Down

0 comments on commit 3aab263

Please sign in to comment.