Update Chart.php

This commit is contained in:
Tom-Magill 2018-07-17 14:11:55 +01:00 committed by GitHub
parent 0c3eb4bafc
commit 139242612d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 2 deletions

View File

@ -105,8 +105,6 @@ class Chart extends AbstractPart
{
$xmlWriter->startElement('c:chart');
$xmlWriter->writeElementBlock('c:autoTitleDeleted', 'val', 1);
$this->writePlotArea($xmlWriter);
$xmlWriter->endElement(); // c:chart
@ -130,6 +128,36 @@ class Chart extends AbstractPart
$type = $this->element->getType();
$style = $this->element->getStyle();
$this->options = $this->types[$type];
$title = $style->getTitle();
$showLegend = $style->getShowLegend();
//Chart title
if($title){
$xmlWriter->startElement('c:title');
$xmlWriter->startElement('c:tx');
$xmlWriter->startElement('c:rich');
$xmlWriter->writeRaw('
<a:bodyPr/>
<a:lstStyle/>
<a:p>
<a:pPr>
<a:defRPr/></a:pPr><a:r><a:rPr/><a:t>'.$title.'</a:t></a:r>
<a:endParaRPr/>
</a:p>');
$xmlWriter->endElement(); // c:rich
$xmlWriter->endElement(); // c:tx
$xmlWriter->endElement(); // c:title
}else{
$xmlWriter->writeElementBlock('c:autoTitleDeleted', 'val', 1);
}
//Chart legend
if($showLegend){
$xmlWriter->writeRaw('<c:legend><c:legendPos val="r"/></c:legend>');
}
$xmlWriter->startElement('c:plotArea');
$xmlWriter->writeElement('c:layout');