Beispiel #1
0
 /**
  * Get hash code
  *
  * @return string Hash code
  */
 public function getHashCode()
 {
     return md5(parent::getHashCode() . $this->_title->getHashCode() . $this->_legend->getHashCode() . $this->_plotArea->getHashCode() . $this->_view3D->getHashCode() . ($this->_includeSpreadsheet ? 1 : 0) . __CLASS__);
 }
Beispiel #2
0
 /**
  * Write Legend
  *
  * @param  PHPPowerPoint_Shared_XMLWriter   $objWriter XML Writer
  * @param  PHPPowerPoint_Shape_Chart_Legend $subject
  * @throws Exception
  */
 protected function _writeLegend(PHPPowerPoint_Shared_XMLWriter $objWriter, PHPPowerPoint_Shape_Chart_Legend $subject)
 {
     // c:legend
     $objWriter->startElement('c:legend');
     // c:legendPos
     $objWriter->startElement('c:legendPos');
     $objWriter->writeAttribute('val', $subject->getPosition());
     $objWriter->endElement();
     // Write layout
     $this->_writeLayout($objWriter, $subject);
     // c:overlay
     $objWriter->startElement('c:overlay');
     $objWriter->writeAttribute('val', '0');
     $objWriter->endElement();
     // c:spPr
     $objWriter->startElement('c:spPr');
     // Fill
     $this->_writeFill($objWriter, $subject->getFill());
     // Border
     if ($subject->getBorder()->getLineStyle() != PHPPowerPoint_Style_Border::LINE_NONE) {
         $this->_writeBorder($objWriter, $subject->getBorder(), '');
     }
     $objWriter->endElement();
     // c:txPr
     $objWriter->startElement('c:txPr');
     // a:bodyPr
     $objWriter->writeElement('a:bodyPr', null);
     // a:lstStyle
     $objWriter->writeElement('a:lstStyle', null);
     // a:p
     $objWriter->startElement('a:p');
     // a:pPr
     $objWriter->startElement('a:pPr');
     $objWriter->writeAttribute('algn', $subject->getAlignment()->getHorizontal());
     $objWriter->writeAttribute('fontAlgn', $subject->getAlignment()->getVertical());
     $objWriter->writeAttribute('marL', PHPPowerPoint_Shared_Drawing::pixelsToEMU($subject->getAlignment()->getMarginLeft()));
     $objWriter->writeAttribute('marR', PHPPowerPoint_Shared_Drawing::pixelsToEMU($subject->getAlignment()->getMarginRight()));
     $objWriter->writeAttribute('indent', PHPPowerPoint_Shared_Drawing::pixelsToEMU($subject->getAlignment()->getIndent()));
     $objWriter->writeAttribute('lvl', $subject->getAlignment()->getLevel());
     // a:defRPr
     $objWriter->startElement('a:defRPr');
     $objWriter->writeAttribute('b', $subject->getFont()->getBold() ? 'true' : 'false');
     $objWriter->writeAttribute('i', $subject->getFont()->getItalic() ? 'true' : 'false');
     $objWriter->writeAttribute('strike', $subject->getFont()->getStrikethrough() ? 'sngStrike' : 'noStrike');
     $objWriter->writeAttribute('sz', $subject->getFont()->getSize() * 100);
     $objWriter->writeAttribute('u', $subject->getFont()->getUnderline());
     if ($subject->getFont()->getSuperScript() || $subject->getFont()->getSubScript()) {
         if ($subject->getFont()->getSuperScript()) {
             $objWriter->writeAttribute('baseline', '30000');
         } elseif ($subject->getFont()->getSubScript()) {
             $objWriter->writeAttribute('baseline', '-25000');
         }
     }
     // Font - a:solidFill
     $objWriter->startElement('a:solidFill');
     // a:srgbClr
     $objWriter->startElement('a:srgbClr');
     $objWriter->writeAttribute('val', $subject->getFont()->getColor()->getRGB());
     $objWriter->endElement();
     $objWriter->endElement();
     // Font - a:latin
     $objWriter->startElement('a:latin');
     $objWriter->writeAttribute('typeface', $subject->getFont()->getName());
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     // a:endParaRPr
     $objWriter->startElement('a:endParaRPr');
     $objWriter->writeAttribute('lang', 'en-US');
     $objWriter->writeAttribute('dirty', '0');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
 }