当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Chart::getTopLeftPosition方法代码示例

本文整理汇总了PHP中PHPExcel_Chart::getTopLeftPosition方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Chart::getTopLeftPosition方法的具体用法?PHP PHPExcel_Chart::getTopLeftPosition怎么用?PHP PHPExcel_Chart::getTopLeftPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Chart的用法示例。


在下文中一共展示了PHPExcel_Chart::getTopLeftPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: writeChart

 /**
  * Write drawings to XML format
  *
  * @param     PHPExcel_Shared_XMLWriter    $objWriter         XML Writer
  * @param     PHPExcel_Chart                $pChart
  * @param     int                            $pRelationId
  * @throws     PHPExcel_Writer_Exception
  */
 public function writeChart(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Chart $pChart = null, $pRelationId = -1)
 {
     $tl = $pChart->getTopLeftPosition();
     $tl['colRow'] = PHPExcel_Cell::coordinateFromString($tl['cell']);
     $br = $pChart->getBottomRightPosition();
     $br['colRow'] = PHPExcel_Cell::coordinateFromString($br['cell']);
     $objWriter->startElement('xdr:twoCellAnchor');
     $objWriter->startElement('xdr:from');
     $objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($tl['colRow'][0]) - 1);
     $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['xOffset']));
     $objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1);
     $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['yOffset']));
     $objWriter->endElement();
     $objWriter->startElement('xdr:to');
     $objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($br['colRow'][0]) - 1);
     $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['xOffset']));
     $objWriter->writeElement('xdr:row', $br['colRow'][1] - 1);
     $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['yOffset']));
     $objWriter->endElement();
     $objWriter->startElement('xdr:graphicFrame');
     $objWriter->writeAttribute('macro', '');
     $objWriter->startElement('xdr:nvGraphicFramePr');
     $objWriter->startElement('xdr:cNvPr');
     $objWriter->writeAttribute('name', 'Chart ' . $pRelationId);
     $objWriter->writeAttribute('id', 1025 * $pRelationId);
     $objWriter->endElement();
     $objWriter->startElement('xdr:cNvGraphicFramePr');
     $objWriter->startElement('a:graphicFrameLocks');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->startElement('xdr:xfrm');
     $objWriter->startElement('a:off');
     $objWriter->writeAttribute('x', '0');
     $objWriter->writeAttribute('y', '0');
     $objWriter->endElement();
     $objWriter->startElement('a:ext');
     $objWriter->writeAttribute('cx', '0');
     $objWriter->writeAttribute('cy', '0');
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->startElement('a:graphic');
     $objWriter->startElement('a:graphicData');
     $objWriter->writeAttribute('uri', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
     $objWriter->startElement('c:chart');
     $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
     $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
     $objWriter->writeAttribute('r:id', 'rId' . $pRelationId);
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->endElement();
     $objWriter->startElement('xdr:clientData');
     $objWriter->endElement();
     $objWriter->endElement();
 }
开发者ID:oalkhanishvili,项目名称:track2,代码行数:64,代码来源:Drawing.php


注:本文中的PHPExcel_Chart::getTopLeftPosition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。