Skip to content

Commit 3aab263

Browse files
authored
Upgrade mitoteam/jpgraph (#3603)
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.
1 parent 9b9e30c commit 3aab263

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ or the appropriate PDF Writer wrapper for the library that you have chosen to in
7474
For Chart export, we support following packages, which you will also need to install yourself using `composer require`
7575
- [jpgraph/jpgraph](https://packagist.org/packages/jpgraph/jpgraph) (this package was abandoned at version 4.0.
7676
You can manually download the latest version that supports PHP 8 and above from [jpgraph.net](https://jpgraph.net/))
77-
- [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) - fork with modern PHP versions support.
77+
- [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) - up to date fork with modern PHP versions support and some bugs fixed.
7878

7979
and then configure PhpSpreadsheet using:
8080
```php

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
8888
"dompdf/dompdf": "^1.0 || ^2.0",
8989
"friendsofphp/php-cs-fixer": "^3.2",
90-
"mitoteam/jpgraph": "^10.2.4",
90+
"mitoteam/jpgraph": "^10.3",
9191
"mpdf/mpdf": "^8.1.1",
9292
"phpcompatibility/php-compatibility": "^9.3",
9393
"phpstan/phpstan": "^1.1",

composer.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/Chart/35_Chart_render33.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
$unresolvedErrors = [];
2525
} else {
2626
$unresolvedErrors = [
27-
// The following spreadsheet was created by 3rd party software,
28-
// and doesn't include the data that usually accompanies a chart.
29-
// That is good enough for Excel, but not for JpGraph.
30-
'33_Chart_create_bar_stacked.xlsx',
27+
//'33_Chart_create_bar_stacked.xlsx', // fixed with mitoteam/jpgraph 10.3
3128
];
3229
}
3330
foreach ($inputFileNames as $inputFileName) {

src/PhpSpreadsheet/Chart/Renderer/MtJpGraphRenderer.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
namespace PhpOffice\PhpSpreadsheet\Chart\Renderer;
44

55
/**
6-
* Jpgraph is not oficially maintained in Composer.
6+
* Jpgraph is not officially maintained by Composer at packagist.org.
77
*
88
* This renderer implementation uses package
99
* https://packagist.org/packages/mitoteam/jpgraph
1010
*
11-
* This package is up to date for August 2022 and has PHP 8.1 support.
11+
* This package is up to date for June 2023 and has PHP 8.2 support.
1212
*/
1313
class MtJpGraphRenderer extends JpGraphRendererBase
1414
{
@@ -29,7 +29,7 @@ protected static function init(): void
2929
'regstat',
3030
'scatter',
3131
'stock',
32-
]);
32+
], true); // enable Extended mode
3333

3434
$loaded = true;
3535
}

0 commit comments

Comments
 (0)