/** * Write chart relationships to XML format * * @param \PhpOffice\PhpPowerpoint\Shape\Chart $pChart * @return string XML Output * @throws \Exception */ public function writeChartRelationships(ShapeChart $pChart) { // Create XML writer $objWriter = $this->getXMLWriter(); // XML header $objWriter->startDocument('1.0', 'UTF-8', 'yes'); // Relationships $objWriter->startElement('Relationships'); $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships'); // Write spreadsheet relationship? if ($pChart->hasIncludedSpreadsheet()) { $this->writeRelationship($objWriter, 1, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/package', '../embeddings/' . $pChart->getIndexedFilename() . '.xlsx'); } $objWriter->endElement(); // Return return $objWriter->getData(); }