Skip to content

Commit

Permalink
phpoffice/phpspreadsheet: Allow version 1.9 or 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Sep 3, 2024
1 parent 7a70b57 commit cf8de60
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 14 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# ![PHPPresentation](https://raw.githubusercontent.com/mvargasmoran/PHPPresentation/develop/docs/images/PHPPresentationLogo.png "PHPPresentation")

[![Latest Stable Version](https://poser.pugx.org/phpoffice/phppresentation/v/stable.png)](https://packagist.org/packages/phpoffice/phppresentation)
[![Coverage Status](https://coveralls.io/repos/github/PHPOffice/PHPPresentation/badge.svg?branch=develop)](https://coveralls.io/github/PHPOffice/PHPPresentation?branch=develop)
[![Total Downloads](https://poser.pugx.org/phpoffice/phppresentation/downloads.png)](https://packagist.org/packages/phpoffice/phppresentation)
[![License](https://poser.pugx.org/phpoffice/phppresentation/license.png)](https://packagist.org/packages/phpoffice/phppresentation)
[![BountySource](https://img.shields.io/bountysource/team/phpoffice/activity.svg)](https://www.bountysource.com/teams/phpoffice)
[![Join the chat at https://gitter.im/PHPOffice/PHPPresentation](https://img.shields.io/badge/Gitter-join%20chat-green.svg)](https://gitter.im/PHPOffice/PHPPresentation)
[![Latest Stable Version](https://poser.pugx.org/phpoffice/phppresentation/v)](https://packagist.org/packages/phpoffice/phppresentation)
[![Coverage Status](https://coveralls.io/repos/github/PHPOffice/PHPPresentation/badge.svg?branch=master)](https://coveralls.io/github/PHPOffice/PHPPresentation?branch=master)
[![Total Downloads](https://poser.pugx.org/phpoffice/phppresentation/downloads)](https://packagist.org/packages/phpoffice/phppresentation)
[![License](https://poser.pugx.org/phpoffice/phppresentation/license)](https://packagist.org/packages/phpoffice/phppresentation)

Branch Master : [![PHPPresentation](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml/badge.svg?branch=master)](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml)

Branch Develop : [![PHPPresentation](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml/badge.svg?branch=develop)](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml)

PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML) or OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF).

PHPPresentation is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPPresentation/blob/develop/COPYING.LESSER). PHPPresentation is aimed to be a high quality software product by incorporating [continuous integration](https://github.com/PHPOffice/PHPPresentation/actions/workflows/php.yml) and [unit testing](https://coveralls.io/github/PHPOffice/PHPPresentation). You can learn more about PHPPresentation by reading the [Developers' Documentation](https://phpoffice.github.io/PHPPresentation) and the [API Documentation](https://phpoffice.github.io/PHPPresentation/docs/).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"ext-xml": "*",
"ext-zip": "*",
"phpoffice/common": "^1",
"phpoffice/phpspreadsheet": "^1.9.0"
"phpoffice/phpspreadsheet": "^1.9 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": ">=7.0",
Expand Down
2 changes: 1 addition & 1 deletion docs/changes/1.1.0.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 1.1.0 - WIP
# 1.1.0

## Features

Expand Down
13 changes: 13 additions & 0 deletions docs/changes/1.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 1.2.0

[Full Changelog](https://github.com/PHPOffice/PHPPresentation/compare/1.1.0...1.2.0)

## Enhancements

- `phpoffice/phpspreadsheet`: Allow version 1.9 or 2.0 by [@Progi1984](https://github.com/Progi1984) fixing [#790](https://github.com/PHPOffice/PHPPresentation/pull/790), [#812](https://github.com/PHPOffice/PHPPresentation/pull/812) in [#816](https://github.com/PHPOffice/PHPPresentation/pull/816)

## Bug fixes

## Miscellaneous

## BC Breaks
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ nav:
- FAQ: 'faq.md'
- Credits: 'credits.md'
- Releases:
- '1.1.0 (WIP)': 'changes/1.1.0.md'
- '1.2.0 (WIP)': 'changes/1.2.0.md'
- '1.1.0': 'changes/1.1.0.md'
- '1.0.0': 'changes/1.0.0.md'
- '0.9.0': 'changes/0.9.0.md'
- '0.8.0': 'changes/0.8.0.md'
Expand Down
6 changes: 3 additions & 3 deletions src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,20 @@ protected function writeSpreadsheet(PhpPresentation $presentation, Chart $chart,
$seriesIndex = 0;
foreach ($chart->getPlotArea()->getType()->getSeries() as $series) {
// Title
$sheet->setCellValueByColumnAndRow(2 + $seriesIndex, 1, $series->getTitle());
$sheet->setCellValue(Coordinate::stringFromColumnIndex(2 + $seriesIndex) . 1, $series->getTitle());

// X-axis
$axisXData = array_keys($series->getValues());
$numAxisXData = count($axisXData);
for ($i = 0; $i < $numAxisXData; ++$i) {
$sheet->setCellValueByColumnAndRow(1, $i + 2, $axisXData[$i]);
$sheet->setCellValue('A' . ($i + 2), $axisXData[$i]);
}

// Y-axis
$axisYData = array_values($series->getValues());
$numAxisYData = count($axisYData);
for ($i = 0; $i < $numAxisYData; ++$i) {
$sheet->setCellValueByColumnAndRow(2 + $seriesIndex, $i + 2, $axisYData[$i]);
$sheet->setCellValue(Coordinate::stringFromColumnIndex(2 + $seriesIndex) . ($i + 2), $axisYData[$i]);
}

++$seriesIndex;
Expand Down

0 comments on commit cf8de60

Please sign in to comment.