A pure PHP library for reading and writing spreadsheet files
Go to file
oleibman 5d5e550342
Additional Support for Chart DataSeriesValues (#2906)
* Additional Support for Chart DataSeriesValues

Fix #2863. DataSeriesValues now extends Properties, allowing it to share code in common with Axis and Gridlines. This causes some minor breakages; in particular line width is now initialized to null instead of Excel's default value, and is specified in points, as the user would expect from Excel, rather than the value stored in Xml.

This change:
- adds support for 1 or 2 marker colors.
- adds support for `smoothLine` to DataSeriesValues.
- will determine `catAx` or `valAx` for Axis based on what is read from the Xml when available, rather than guessing based on format. (Another minor break.)
- reads `formatCode` and `sourceLinked` for Axis.
- correct 2 uses of `$plotSeriesRef` to `$plotSeriesIndex` in Writer/Xlsx/Chart.
- pushes coverage over 90% for Chart (88.70% overall).

* Update Change Log

I had updated previously but forgot to stage the member.

* Adopt Some Suggestions

Incorporate some changes suggested by @bridgeplayr.

* Use ChartColor for DSV Fill And Font Text

DataSeriesValues Fill could be a scalar or an array, so I saved it till last.

* Some Final Cleanup

No code changes.

Illustrate even more of the new features in existing sample files.

Deprecate *_ARGB in Properties/ChartColors in favor of *_RGB, because it uses only 6 hex digits. The alpha value is stored separately.
2022-06-29 17:52:09 -07:00
.github Add PHP 8.2 with allow fail 2022-06-15 13:59:58 +02:00
bin pre-commit for php-cs-fixer 3 2021-11-17 23:15:32 +09:00
docs Update change log and documentation 2022-06-15 12:59:38 +02:00
infra Locale Generator - Change to Use Unix Line Endings Even on Windows (#2174) 2021-06-19 10:20:16 +02:00
samples Additional Support for Chart DataSeriesValues (#2906) 2022-06-29 17:52:09 -07:00
src/PhpSpreadsheet Additional Support for Chart DataSeriesValues (#2906) 2022-06-29 17:52:09 -07:00
tests Additional Support for Chart DataSeriesValues (#2906) 2022-06-29 17:52:09 -07:00
.gitattributes Additional language data, and improved automated build of translation files for Calculation Engine locale 2021-05-20 20:41:09 +02:00
.gitignore Make Documentation Updates Easier and More Accurate (#1573) 2021-02-15 20:50:20 +01:00
.php-cs-fixer.dist.php Add functionality to adjust CellRange by "modifying" the from/to CellAddress Value objects 2022-04-01 15:41:55 +02:00
.phpcs.xml.dist Move phpcs config to file 2020-07-26 14:48:06 +09:00
.scrutinizer.yml Scrutinizer wait shorter for coverage 2020-05-25 11:20:08 +09:00
CHANGELOG.PHPExcel.md Prefer https:// URLs when available in docs & comments 2018-10-28 13:55:00 +11:00
CHANGELOG.md Additional Support for Chart DataSeriesValues (#2906) 2022-06-29 17:52:09 -07:00
CONTRIBUTING.md Document release process 2021-03-30 10:11:46 +09:00
LICENSE Change license from LGPL 2.1 to MIT 2019-11-17 18:08:34 +01:00
README.md Declare a few return datatypes 2022-05-26 15:20:41 +02:00
composer.json phpcs update to version 3.7.0 to ensure it catches all the PHP 8.1 updates 2022-06-15 13:33:42 +02:00
composer.lock Update php codesniffer 2022-06-19 11:33:09 +02:00
mkdocs.yml Make Documentation Updates Easier and More Accurate (#1573) 2021-02-15 20:50:20 +01:00
phpstan-baseline.neon Additional Support for Chart DataSeriesValues (#2906) 2022-06-29 17:52:09 -07:00
phpstan-conditional.php Cleanup After Phpstan Upgrade (#2800) 2022-05-10 07:20:22 -07:00
phpstan.neon.dist Have Phpstan Ignore Chart/Renderer/JpGraph (#2901) 2022-06-19 19:22:10 -07:00
phpunit.xml.dist Update Phpunit Configuration File 2021-11-18 13:02:20 +09:00

README.md

PhpSpreadsheet

Build Status Code Quality Code Coverage Total Downloads Latest Stable Version License Join the chat at https://gitter.im/PHPOffice/PhpSpreadsheet

PhpSpreadsheet is a library written in pure PHP and offers a set of classes that allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.

PHP version support

LTS: Support for PHP versions will only be maintained for a period of six months beyond the end of life of that PHP version.

Currently the required PHP minimum version is PHP 7.3.

See the composer.json for other requirements.

Installation

Use composer to install PhpSpreadsheet into your project:

composer require phpoffice/phpspreadsheet

If you are building your installation on a development machine that is on a different PHP version to the server where it will be deployed, or if your PHP CLI version is not the same as your run-time such as php-fpm or Apache's mod_php, then you might want to add the following to your composer.json before installing:

{
    "require": {
        "phpoffice/phpspreadsheet": "^1.23"
    },
    "config": {
        "platform": {
            "php": "7.3"
        }
    }
}

and then run

composer install

to ensure that the correct dependencies are retrieved to match your deployment environment.

See CLI vs Application run-time for more details.

Documentation

Read more about it, including install instructions, in the official documentation. Or check out the API documentation.

Please ask your support questions on StackOverflow, or have a quick chat on Gitter.

PHPExcel vs PhpSpreadsheet ?

PhpSpreadsheet is the next version of PHPExcel. It breaks compatibility to dramatically improve the code base quality (namespaces, PSR compliance, use of latest PHP language features, etc.).

Because all efforts have shifted to PhpSpreadsheet, PHPExcel will no longer be maintained. All contributions for PHPExcel, patches and new features, should target PhpSpreadsheet master branch.

Do you need to migrate? There is an automated tool for that.

License

PhpSpreadsheet is licensed under MIT.