Bugfixes to Chart Reader and Writer
This commit is contained in:
parent
59932b0cac
commit
946ea73ddb
|
@ -64,7 +64,8 @@ class PHPExcel_Reader_Excel2007_Chart
|
|||
$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) {
|
||||
|
|
|
@ -114,6 +114,10 @@ class PHPExcel_Shared_XMLWriter extends XMLWriter {
|
|||
*/
|
||||
public function writeRawData($text)
|
||||
{
|
||||
if (is_array($text)) {
|
||||
$text = implode("\n",$text);
|
||||
}
|
||||
|
||||
if (method_exists($this, 'writeRaw')) {
|
||||
return $this->writeRaw(htmlspecialchars($text));
|
||||
}
|
||||
|
|
|
@ -955,14 +955,19 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
|
|||
|
||||
$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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue