public function PHPExcel_Writer_Excel2007_Drawing::_writeChart in Loft Data Grids 7.2
Same name and namespace in other branches
- 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Drawing.php \PHPExcel_Writer_Excel2007_Drawing::_writeChart()
* Write drawings to XML format * *
Parameters
PHPExcel_Shared_XMLWriter $objWriter XML Writer: * @param PHPExcel_Chart $pChart * @param int $pRelationId * @throws PHPExcel_Writer_Exception
1 call to PHPExcel_Writer_Excel2007_Drawing::_writeChart()
- PHPExcel_Writer_Excel2007_Drawing::writeDrawings in vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ Excel2007/ Drawing.php - * Write drawings to XML format * *
File
- vendor/
phpoffice/ phpexcel/ Classes/ PHPExcel/ Writer/ Excel2007/ Drawing.php, line 100
Class
- PHPExcel_Writer_Excel2007_Drawing
- PHPExcel_Writer_Excel2007_Drawing
Code
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();
}