Esempio n. 1
0
 public function testConstruct()
 {
     $object = new Chart();
     $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->getTitle());
     $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->getLegend());
     $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->getPlotArea());
     $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->getView3D());
 }
Esempio n. 2
0
 /**
  * @param Chart $chart
  */
 private function writeLegendStyle(Chart $chart)
 {
     // style:style
     $this->xmlContent->startElement('style:style');
     $this->xmlContent->writeAttribute('style:name', 'styleLegend');
     $this->xmlContent->writeAttribute('style:family', 'chart');
     // style:text-properties
     $this->xmlContent->startElement('style:text-properties');
     $this->xmlContent->writeAttribute('fo:color', '#' . $chart->getLegend()->getFont()->getColor()->getRGB());
     $this->xmlContent->writeAttribute('fo:font-family', $chart->getLegend()->getFont()->getName());
     $this->xmlContent->writeAttribute('fo:font-size', $chart->getLegend()->getFont()->getSize() . 'pt');
     $this->xmlContent->writeAttribute('fo:font-style', $chart->getLegend()->getFont()->isItalic() ? 'italic' : 'normal');
     // > style:text-properties
     $this->xmlContent->endElement();
     // > style:style
     $this->xmlContent->endElement();
 }