Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
Minor charting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Baker committed Oct 26, 2012
1 parent a3303cd commit 9be433a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Classes/PHPExcel/Chart/DataSeriesValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ public function refresh(PHPExcel_Worksheet $worksheet, $flatten = TRUE) {
);
if ($flatten) {
$this->_dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues);
foreach($this->_dataValues as &$dataValue) {
if ((!empty($dataValue)) && ($dataValue[0] == '#')) {
$dataValue = 0.0;
}
}
unset($dataValue);
} else {
$cellRange = explode('!',$this->_dataSource);
if (count($cellRange) > 1) {
Expand Down
4 changes: 4 additions & 0 deletions Classes/PHPExcel/Reader/Excel2007/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ private static function _chartDataSeriesValues($seriesValueSet,$dataType='n') {
}
}

if (empty($seriesVal)) {
$seriesVal = NULL;
}

return array( 'formatCode' => $formatCode,
'pointCount' => $pointCount,
'dataValues' => $seriesVal
Expand Down
14 changes: 7 additions & 7 deletions Classes/PHPExcel/Writer/Excel2007/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,13 @@ private function _writeCatAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAx
$objWriter->endElement();
$objWriter->endElement();

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

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

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

$objWriter->endElement();

}
Expand Down Expand Up @@ -589,15 +589,15 @@ private function _writeValAx($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAx
$objWriter->endElement();
$objWriter->endElement();

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

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

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

$objWriter->endElement();
}

Expand Down
4 changes: 3 additions & 1 deletion Classes/PHPExcel/Writer/Excel2007/Worksheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ private function _writeProtectedRanges(PHPExcel_Shared_XMLWriter $objWriter = nu
$objWriter->startElement('protectedRange');
$objWriter->writeAttribute('name', 'p' . md5($protectedCell));
$objWriter->writeAttribute('sqref', $protectedCell);
$objWriter->writeAttribute('password', $passwordHash);
if (!empty($passwordHash)) {
$objWriter->writeAttribute('password', $passwordHash);
}
$objWriter->endElement();
}

Expand Down

0 comments on commit 9be433a

Please sign in to comment.