Skip to content

Commit

Permalink
Merge branch 'develop' into feature/gh-7
Browse files Browse the repository at this point in the history
# Conflicts:
#	tests/PhpSpreadsheet/Shared/DateTest.php
  • Loading branch information
MarkBaker committed Aug 14, 2016
2 parents f0e167c + d19f736 commit aa97bb3
Show file tree
Hide file tree
Showing 45 changed files with 690 additions and 550 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
build/PHPExcel.phar
tests/codeCoverage
analysis
/build/PHPExcel.phar
/tests/codeCoverage
/analysis
/vendor/
/composer.lock

## IDE support
*.buildpath
Expand Down
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
# PHPSpreadsheet - OpenXML - Read, Write and Create spreadsheet documents in PHP - Spreadsheet engine
PHPSpreadsheet is a library written in pure PHP and providing a set of classes that allow you to write to and read from different spreadsheet file formats, like Excel (BIFF) .xls, Excel 2007 (OfficeOpenXML) .xlsx, CSV, Libre/OpenOffice Calc .ods, Gnumeric, PDF, HTML, ... This project is built around Microsoft's OpenXML standard and PHP.

Master: [![Build Status](https://travis-ci.org/PHPOffice/PhpSpreadsheet.png?branch=master)](http://travis-ci.org/PHPOffice/PhpSpreadsheet)

Develop: [![Build Status](https://travis-ci.org/PHPOffice/PhpSpreadsheet.png?branch=develop)](http://travis-ci.org/PHPOffice/PhpSpreadsheet)

# PhpSpreadsheet - OpenXML - Read, Write and Create spreadsheet documents in PHP - Spreadsheet engine

Master:
[![Build Status](https://travis-ci.org/PHPOffice/PhpSpreadsheet.svg?branch=master)](https://travis-ci.org/PHPOffice/PhpSpreadsheet)
[![Code Quality](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
[![Total Downloads](https://poser.pugx.org/phpoffice/phpspreadsheet/downloads.png)](https://packagist.org/packages/phpoffice/phpspreadsheet)
[![Latest Stable Version](https://poser.pugx.org/phpoffice/phpspreadsheet/v/stable.png)](https://packagist.org/packages/phpoffice/phpspreadsheet)
[![License](https://poser.pugx.org/phpoffice/phpspreadsheet/license.png)](https://packagist.org/packages/phpoffice/phpspreadsheet)
[![Join the chat at https://gitter.im/PHPOffice/PhpSpreadsheet](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PhpSpreadsheet)

## File Formats supported
Develop:
[![Build Status](https://travis-ci.org/PHPOffice/PhpSpreadsheet.png?branch=develop)](http://travis-ci.org/PHPOffice/PhpSpreadsheet)
[![Code Quality](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=develop)
[![Code Coverage](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=develop)

### Reading
* BIFF 5-8 (.xls) Excel 95 and above
* Office Open XML (.xlsx) Excel 2007 and above
* SpreadsheetML (.xml) Excel 2003
* Open Document Format/OASIS (.ods)
* Gnumeric
* HTML
* SYLK
* CSV
PhpSpreadsheet is a library written in pure PHP and providing a set of classes that allow you to write to and read from different spreadsheet file formats, like Excel (BIFF) .xls, Excel 2007 (OfficeOpenXML) .xlsx, CSV, Libre/OpenOffice Calc .ods, Gnumeric, PDF, HTML, ... This project is built around Microsoft's OpenXML standard and PHP.

### Writing
* BIFF 8 (.xls) Excel 95 and above
* Office Open XML (.xlsx) Excel 2007 and above
* HTML
* CSV
* PDF (using either the tcPDF, DomPDF or mPDF libraries, which need to be installed separately)
## File Formats supported

|Format |Reading|Writing|
|--------------------------------------------|:-----:|:-----:|
|Open Document Format/OASIS (.ods) |||
|Office Open XML (.xlsx) Excel 2007 and above|||
|BIFF 8 (.xls) Excel 97 and above |||
|BIFF 5 (.xls) Excel 95 || |
|SpreadsheetML (.xml) Excel 2003 || |
|Gnumeric || |
|HTML |||
|SYLK || |
|CSV |||
|PDF (using either the tcPDF, DomPDF or mPDF libraries, which need to be installed separately)| ||

## Requirements
* PHP version 5.5.0 or higher
* PHP extension php_zip enabled (required if you need PHPSpreadsheet to handle .xlsx .ods or .gnumeric files)
* PHP extension php_zip enabled (required if you need PhpSpreadsheet to handle .xlsx .ods or .gnumeric files)
* PHP extension php_xml enabled
* PHP extension php_gd2 enabled (optional, but required for exact column width autocalculation)

Expand All @@ -46,4 +50,4 @@ If you would like to contribute, here are some notes and guidlines:


## License
PHPSpreadsheet is licensed under [LGPL (GNU LESSER GENERAL PUBLIC LICENSE)](https://github.com/PHPOffice/PhpSpreadsheet/blob/master/license.md)
PhpSpreadsheet is licensed under [LGPL (GNU LESSER GENERAL PUBLIC LICENSE)](https://github.com/PHPOffice/PhpSpreadsheet/blob/master/license.md)
35 changes: 18 additions & 17 deletions src/PhpSpreadsheet/Writer/Excel2007/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ public function writeChart(\PHPExcel\Chart $pChart = null, $calculateCellValues

$objWriter->startElement('c:chart');

$this->writeTitle($pChart->getTitle(), $objWriter);
$this->writeTitle($objWriter, $pChart->getTitle());

$objWriter->startElement('c:autoTitleDeleted');
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();

$this->writePlotArea($pChart->getPlotArea(), $pChart->getXAxisLabel(), $pChart->getYAxisLabel(), $objWriter, $pChart->getWorksheet(), $pChart->getChartAxisX(), $pChart->getChartAxisY(), $pChart->getMajorGridlines(), $pChart->getMinorGridlines());
$this->writePlotArea($objWriter, $pChart->getWorksheet(), $pChart->getPlotArea(), $pChart->getXAxisLabel(), $pChart->getYAxisLabel(), $pChart->getChartAxisX(), $pChart->getChartAxisY(), $pChart->getMajorGridlines(), $pChart->getMinorGridlines());

$this->writeLegend($pChart->getLegend(), $objWriter);
$this->writeLegend($objWriter, $pChart->getLegend());

$objWriter->startElement('c:plotVisOnly');
$objWriter->writeAttribute('val', 1);
Expand All @@ -121,12 +121,12 @@ public function writeChart(\PHPExcel\Chart $pChart = null, $calculateCellValues
/**
* Write Chart Title
*
* @param Title $title
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
* @param Title $title
*
* @throws \PHPExcel\Writer\Exception
*/
private function writeTitle(Title $title=null, $objWriter)
private function writeTitle(\PHPExcel\Shared\XMLWriter $objWriter, Title $title = null)
{
if (is_null($title)) {
return;
Expand Down Expand Up @@ -154,7 +154,7 @@ private function writeTitle(Title $title=null, $objWriter)
$objWriter->endElement();
$objWriter->endElement();

$this->writeLayout($title->getLayout(), $objWriter);
$this->writeLayout($objWriter, $title->getLayout());

$objWriter->startElement('c:overlay');
$objWriter->writeAttribute('val', 0);
Expand All @@ -166,12 +166,12 @@ private function writeTitle(Title $title=null, $objWriter)
/**
* Write Chart Legend
*
* @param Legend $legend
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
* @param Legend $legend
*
* @throws \PHPExcel\Writer\Exception
*/
private function writeLegend(Legend $legend=null, $objWriter)
private function writeLegend(\PHPExcel\Shared\XMLWriter $objWriter, Legend $legend = null)
{
if (is_null($legend)) {
return;
Expand All @@ -183,7 +183,7 @@ private function writeLegend(Legend $legend=null, $objWriter)
$objWriter->writeAttribute('val', $legend->getPosition());
$objWriter->endElement();

$this->writeLayout($legend->getLayout(), $objWriter);
$this->writeLayout($objWriter, $legend->getLayout());

$objWriter->startElement('c:overlay');
$objWriter->writeAttribute('val', ($legend->getOverlay()) ? '1' : '0');
Expand Down Expand Up @@ -217,16 +217,17 @@ private function writeLegend(Legend $legend=null, $objWriter)
/**
* Write Chart Plot Area
*
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
* @param \PHPExcel\Worksheet $pSheet
* @param PlotArea $plotArea
* @param Title $xAxisLabel
* @param Title $yAxisLabel
* @param Axis $xAxis
* @param Axis $yAxis
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
*
* @throws \PHPExcel\Writer\Exception
*/
private function writePlotArea(PlotArea $plotArea, Title $xAxisLabel=null, Title $yAxisLabel=null, $objWriter, \PHPExcel\Worksheet $pSheet, Axis $xAxis=null, Axis $yAxis=null, GridLines $majorGridlines=null, GridLines $minorGridlines=null)
private function writePlotArea(\PHPExcel\Shared\XMLWriter $objWriter, \PHPExcel\Worksheet $pSheet, PlotArea $plotArea, Title $xAxisLabel = null, Title $yAxisLabel = null, Axis $xAxis = null, Axis $yAxis = null, GridLines $majorGridlines = null, GridLines $minorGridlines = null)
{
if (is_null($plotArea)) {
return;
Expand All @@ -238,7 +239,7 @@ private function writePlotArea(PlotArea $plotArea, Title $xAxisLabel=null, Title

$layout = $plotArea->getLayout();

$this->writeLayout($layout, $objWriter);
$this->writeLayout($objWriter, $layout);

$chartTypes = self::getChartType($plotArea);
$catIsMultiLevelSeries = $valIsMultiLevelSeries = false;
Expand Down Expand Up @@ -361,7 +362,7 @@ private function writePlotArea(PlotArea $plotArea, Title $xAxisLabel=null, Title
*
* @throws \PHPExcel\Writer\Exception
*/
private function writeDataLabels($objWriter, Layout $chartLayout=null)
private function writeDataLabels($objWriter, Layout $chartLayout = null)
{
$objWriter->startElement('c:dLbls');

Expand Down Expand Up @@ -469,7 +470,7 @@ private function writeCategoryAxis($objWriter, PlotArea $plotArea, $xAxisLabel,
$objWriter->endElement();

$layout = $xAxisLabel->getLayout();
$this->writeLayout($layout, $objWriter);
$this->writeLayout($objWriter, $layout);

$objWriter->startElement('c:overlay');
$objWriter->writeAttribute('val', 0);
Expand Down Expand Up @@ -820,7 +821,7 @@ private function writeValueAxis($objWriter, PlotArea $plotArea, $yAxisLabel, $gr

if ($groupType !== DataSeries::TYPE_BUBBLECHART) {
$layout = $yAxisLabel->getLayout();
$this->writeLayout($layout, $objWriter);
$this->writeLayout($objWriter, $layout);
}

$objWriter->startElement('c:overlay');
Expand Down Expand Up @@ -1399,12 +1400,12 @@ private function writeBubbles($plotSeriesValues, $objWriter)
/**
* Write Layout
*
* @param Layout $layout
* @param \PHPExcel\Shared\XMLWriter $objWriter XML Writer
* @param Layout $layout
*
* @throws \PHPExcel\Writer\Exception
*/
private function writeLayout(Layout $layout=null, $objWriter)
private function writeLayout(\PHPExcel\Shared\XMLWriter $objWriter, Layout $layout = null)
{
$objWriter->startElement('c:layout');

Expand Down
Loading

0 comments on commit aa97bb3

Please sign in to comment.