Skip to content

Commit febd8d8

Browse files
authored
Merge branch 'master' into Expand-Return-Datatypes
2 parents b783fec + bb072d1 commit febd8d8

File tree

19 files changed

+191
-140
lines changed

19 files changed

+191
-140
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ and this project adheres to [Semantic Versioning](https://semver.org).
1313
- Implementation of the `ARRAYTOTEXT()` Excel Function
1414
- Support for [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) implementation of
1515
JpGraph library to render charts added.
16+
- Charts: Add Gradients, Transparency, Hidden Axes, Rounded Corners, Trendlines.
1617

1718
### Changed
1819

1920
- Nothing
2021

2122
### Deprecated
2223

23-
- Nothing
24+
- Axis getLineProperty deprecated in favor of getLineColorProperty.
25+
- Moved majorGridlines and minorGridlines from Chart to Axis. Setting either in Chart constructor or through Chart methods, or getting either using Chart methods is deprecated.
26+
- Chart::EXCEL_COLOR_TYPE_* copied from Properties to ChartColor; use in Properties is deprecated.
27+
- ChartColor::EXCEL_COLOR_TYPE_ARGB deprecated in favor of EXCEL_COLOR_TYPE_RGB ("A" component was never allowed).
28+
- Misspelled Properties::LINE_STYLE_DASH_SQUERE_DOT deprecated in favor of LINE_STYLE_DASH_SQUARE_DOT.
29+
- Clone not permitted for Spreadsheet. Spreadsheet->copy() can be used instead.
2430

2531
### Removed
2632

@@ -30,6 +36,14 @@ and this project adheres to [Semantic Versioning](https://semver.org).
3036

3137
- Fully flatten an array [Issue #2955](https://github.com/PHPOffice/PhpSpreadsheet/issues/2955) [PR #2956](https://github.com/PHPOffice/PhpSpreadsheet/pull/2956)
3238
- cellExists() and getCell() methods should support UTF-8 named cells [Issue #2987](https://github.com/PHPOffice/PhpSpreadsheet/issues/2987) [PR #2988](https://github.com/PHPOffice/PhpSpreadsheet/pull/2988)
39+
- Spreadsheet copy fixed, clone disabled. [PR #2951](https://github.com/PHPOffice/PhpSpreadsheet/pull/2951)
40+
- Fix PDF problems with text rotation and paper size. [Issue #1747](https://github.com/PHPOffice/PhpSpreadsheet/issues/1747) [Issue #1713](https://github.com/PHPOffice/PhpSpreadsheet/issues/1713) [PR #2960](https://github.com/PHPOffice/PhpSpreadsheet/pull/2960)
41+
- Limited support for chart titles as formulas [Issue #2965](https://github.com/PHPOffice/PhpSpreadsheet/issues/2965) [Issue #749](https://github.com/PHPOffice/PhpSpreadsheet/issues/749) [PR #2971](https://github.com/PHPOffice/PhpSpreadsheet/pull/2971)
42+
- Add Gradients, Transparency, and Hidden Axes to Chart [Issue #2257](https://github.com/PHPOffice/PhpSpreadsheet/issues/2257) [Issue #2229](https://github.com/PHPOffice/PhpSpreadsheet/issues/2929) [Issue #2935](https://github.com/PHPOffice/PhpSpreadsheet/issues/2935) [PR #2950](https://github.com/PHPOffice/PhpSpreadsheet/pull/2950)
43+
- Chart Support for Rounded Corners and Trendlines [Issue #2968](https://github.com/PHPOffice/PhpSpreadsheet/issues/2968) [Issue #2815](https://github.com/PHPOffice/PhpSpreadsheet/issues/2815) [PR #2976](https://github.com/PHPOffice/PhpSpreadsheet/pull/2976)
44+
- Add setName Method for Chart [Issue #2991](https://github.com/PHPOffice/PhpSpreadsheet/issues/2991) [PR #3001](https://github.com/PHPOffice/PhpSpreadsheet/pull/3001)
45+
- Eliminate partial dependency on php-intl in StringHelper [Issue #2982](https://github.com/PHPOffice/PhpSpreadsheet/issues/2982) [PR #2994](https://github.com/PHPOffice/PhpSpreadsheet/pull/2994)
46+
- Minor changes for Pdf [Issue #2999](https://github.com/PHPOffice/PhpSpreadsheet/issues/2999) [PR #3002](https://github.com/PHPOffice/PhpSpreadsheet/pull/3002) [PR #3006](https://github.com/PHPOffice/PhpSpreadsheet/pull/3006)
3347

3448
## 1.24.1 - 2022-07-18
3549

composer.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,21 @@
8181
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
8282
"dompdf/dompdf": "^1.0 || ^2.0",
8383
"friendsofphp/php-cs-fixer": "^3.2",
84-
"jpgraph/jpgraph": "^4.0",
84+
"mitoteam/jpgraph": "^10.1",
8585
"mpdf/mpdf": "8.1.1",
8686
"phpcompatibility/php-compatibility": "^9.3",
8787
"phpstan/phpstan": "^1.1",
8888
"phpstan/phpstan-phpunit": "^1.0",
8989
"phpunit/phpunit": "^8.5 || ^9.0",
9090
"squizlabs/php_codesniffer": "^3.7",
91-
"tecnickcom/tcpdf": "^6.4"
91+
"tecnickcom/tcpdf": "6.5"
9292
},
9393
"suggest": {
94+
"ext-intl": "PHP Internationalization Functions",
9495
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
95-
"dompdf/dompdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)",
96-
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)",
97-
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers"
96+
"dompdf/dompdf": "Option for rendering PDF with PDF Writer",
97+
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer",
98+
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers"
9899
},
99100
"autoload": {
100101
"psr-4": {

composer.lock

Lines changed: 54 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ parameters:
1212
excludePaths:
1313
- src/PhpSpreadsheet/Chart/Renderer/JpGraph.php
1414
- src/PhpSpreadsheet/Chart/Renderer/JpGraphRendererBase.php
15-
- src/PhpSpreadsheet/Chart/Renderer/MtJpGraphRenderer.php
1615
parallel:
1716
processTimeout: 300.0
1817
checkMissingIterableValueType: false

samples/Chart/32_Chart_read_write_HTML.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
require __DIR__ . '/../Header.php';
77

88
// Change these values to select the Rendering library that you wish to use
9-
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
9+
//Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
10+
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\MtJpGraphRenderer::class);
1011

1112
$inputFileType = 'Xlsx';
1213
$inputFileNames = __DIR__ . '/../templates/36write*.xlsx';

samples/Chart/32_Chart_read_write_PDF.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
IOFactory::registerWriter('Pdf', \PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf::class);
99

1010
// Change these values to select the Rendering library that you wish to use
11-
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
11+
//Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
12+
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\MtJpGraphRenderer::class);
1213

1314
$inputFileType = 'Xlsx';
1415
$inputFileNames = __DIR__ . '/../templates/36write*.xlsx';

samples/Chart/35_Chart_render.php

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55

66
require __DIR__ . '/../Header.php';
77

8-
if (PHP_VERSION_ID >= 80000) {
9-
$helper->log('Jpgraph no longer runs against PHP8');
10-
exit;
11-
}
12-
138
// Change these values to select the Rendering library that you wish to use
14-
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
9+
//Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
10+
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\MtJpGraphRenderer::class);
1511

1612
$inputFileType = 'Xlsx';
1713
$inputFileNames = __DIR__ . '/../templates/32readwrite*[0-9].xlsx';
14+
//$inputFileNames = __DIR__ . '/../templates/32readwriteStockChart5.xlsx';
1815

1916
if ((isset($argc)) && ($argc > 1)) {
2017
$inputFileNames = [];
@@ -24,6 +21,18 @@
2421
} else {
2522
$inputFileNames = glob($inputFileNames);
2623
}
24+
if (count($inputFileNames) === 1) {
25+
$unresolvedErrors = [];
26+
} else {
27+
$unresolvedErrors = [
28+
'32readwriteBubbleChart2.xlsx',
29+
'32readwritePieChart3.xlsx',
30+
'32readwritePieChart4.xlsx',
31+
'32readwritePieChart3D1.xlsx',
32+
'32readwritePieChartExploded1.xlsx',
33+
'32readwritePieChartExploded3D1.xlsx',
34+
];
35+
}
2736
foreach ($inputFileNames as $inputFileName) {
2837
$inputFileNameShort = basename($inputFileName);
2938

@@ -32,6 +41,11 @@
3241

3342
continue;
3443
}
44+
if (in_array($inputFileNameShort, $unresolvedErrors, true)) {
45+
$helper->log('File ' . $inputFileNameShort . ' does not yet work with this script');
46+
47+
continue;
48+
}
3549

3650
$helper->log("Load Test from $inputFileType file " . $inputFileNameShort);
3751

samples/Pdf/21a_Pdf.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
$helper->log('Set orientation to landscape');
1313
$spreadsheet->getActiveSheet()->getPageSetup()->setOrientation(PageSetup::ORIENTATION_LANDSCAPE);
1414
$spreadsheet->setActiveSheetIndex(0)->setPrintGridlines(true);
15+
// Issue 2299 - mpdf can't handle hide rows without kludge
16+
$spreadsheet->getActiveSheet()->getRowDimension(2)->setVisible(false);
1517

1618
function changeGridlines(string $html): string
1719
{

src/PhpSpreadsheet/Chart/Chart.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ public function getName()
188188
return $this->name;
189189
}
190190

191+
public function setName(string $name): self
192+
{
193+
$this->name = $name;
194+
195+
return $this;
196+
}
197+
191198
/**
192199
* Get Worksheet.
193200
*/
@@ -654,14 +661,10 @@ public function refresh(): void
654661

655662
/**
656663
* Render the chart to given file (or stream).
657-
* Unable to cover code until a usable current version of JpGraph
658-
* is made available through Composer.
659664
*
660665
* @param string $outputDestination Name of the file render to
661666
*
662667
* @return bool true on success
663-
*
664-
* @codeCoverageIgnore
665668
*/
666669
public function render($outputDestination = null)
667670
{

0 commit comments

Comments
 (0)