Update Chart.php
This commit is contained in:
parent
0c3eb4bafc
commit
139242612d
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in New Issue