Skip to content

Commit

Permalink
Bugfixes to Chart Reader and Writer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Baker committed Jul 20, 2012
1 parent 59932b0 commit 946ea73
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Classes/PHPExcel/Reader/Excel2007/Chart.php
Expand Up @@ -64,7 +64,8 @@ public static function readChart($chartElements,$chartName) {
$namespacesChartMeta = $chartElements->getNamespaces(true);
$chartElementsC = $chartElements->children($namespacesChartMeta['c']);

$XaxisLabel = $YaxisLabel = $legend = $title = null;
$XaxisLabel = $YaxisLabel = $legend = $title = NULL;
$dispBlanksAs = $plotVisOnly = NULL;

foreach($chartElementsC as $chartElementKey => $chartElement) {
switch ($chartElementKey) {
Expand Down
4 changes: 4 additions & 0 deletions Classes/PHPExcel/Shared/XMLWriter.php
Expand Up @@ -114,6 +114,10 @@ public function getData() {
*/
public function writeRawData($text)
{
if (is_array($text)) {
$text = implode("\n",$text);
}

if (method_exists($this, 'writeRaw')) {
return $this->writeRaw(htmlspecialchars($text));
}
Expand Down
17 changes: 11 additions & 6 deletions Classes/PHPExcel/Writer/Excel2007/Chart.php
Expand Up @@ -955,14 +955,19 @@ private function _writePlotSeriesValues($plotSeriesValues, $objWriter, $groupTyp

$dataValues = $plotSeriesValues->getDataValues();
if (!empty($dataValues)) {
foreach($dataValues as $plotSeriesKey => $plotSeriesValue) {
$objWriter->startElement('c:pt');
$objWriter->writeAttribute('idx', $plotSeriesKey );
if (!is_array($dataValues)) {
var_dump($dataValues);
}
if (is_array($dataValues)) {
foreach($dataValues as $plotSeriesKey => $plotSeriesValue) {
$objWriter->startElement('c:pt');
$objWriter->writeAttribute('idx', $plotSeriesKey );

$objWriter->startElement('c:v');
$objWriter->writeRawData( $plotSeriesValue );
$objWriter->startElement('c:v');
$objWriter->writeRawData( $plotSeriesValue );
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
}
}
}

Expand Down

0 comments on commit 946ea73

Please sign in to comment.