コード例 #1
0
ファイル: Chart.php プロジェクト: phaidra/phaidraplus
 /**
  * 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__);
 }
コード例 #2
0
ファイル: Chart.php プロジェクト: phaidra/phaidraplus
 /**
  * Write Title
  *
  * @param  PHPPowerPoint_Shared_XMLWriter  $objWriter XML Writer
  * @param  PHPPowerPoint_Shape_Chart_Title $subject
  * @throws Exception
  */
 protected function _writeTitle(PHPPowerPoint_Shared_XMLWriter $objWriter, PHPPowerPoint_Shape_Chart_Title $subject)
 {
     // c:title
     $objWriter->startElement('c:title');
     // c:tx
     $objWriter->startElement('c:tx');
     // c:rich
     $objWriter->startElement('c:rich');
     // 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->writeElement('a:defRPr', null);
     $objWriter->endElement();
     // a:r
     $objWriter->startElement('a:r');
     // a:rPr
     $objWriter->startElement('a:rPr');
     $objWriter->writeAttribute('lang', 'en-US');
     $objWriter->writeAttribute('dirty', '0');
     $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();
     // a:t
     $objWriter->writeElement('a:t', $subject->getText());
     $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();
     // Write layout
     $this->_writeLayout($objWriter, $subject);
     // c:overlay
     $objWriter->startElement('c:overlay');
     $objWriter->writeAttribute('val', '0');
     $objWriter->endElement();
     $objWriter->endElement();
 }