Skip to content

Commit

Permalink
Add Chart name
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-ro-fr committed Feb 22, 2024
1 parent 339ddcf commit ac085bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/PhpSpreadsheet/Reader/Xlsx.php
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,7 @@ protected function loadSpreadsheetFromFile(string $filename): Spreadsheet
'height' => $height,
'worksheetTitle' => $docSheet->getTitle(),
'oneCellAnchor' => true,
'name' => self::getAttributes($twoCellAnchor->graphicFrame->nvGraphicFramePr->cNvPr)->name,

Check failure on line 1455 in src/PhpSpreadsheet/Reader/Xlsx.php

View workflow job for this annotation

GitHub Actions / phpstan

Variable $twoCellAnchor might not be defined.
];
}
}
Expand Down Expand Up @@ -1547,6 +1548,7 @@ protected function loadSpreadsheetFromFile(string $filename): Spreadsheet
'toOffsetX' => $toOffsetX,
'toOffsetY' => $toOffsetY,
'worksheetTitle' => $docSheet->getTitle(),
'name' => self::getAttributes($twoCellAnchor->graphicFrame->nvGraphicFramePr->cNvPr)->name,
];
}
}
Expand All @@ -1568,6 +1570,7 @@ protected function loadSpreadsheetFromFile(string $filename): Spreadsheet
'width' => $width,
'height' => $height,
'worksheetTitle' => $docSheet->getTitle(),
'name' => self::getAttributes($twoCellAnchor->graphicFrame->nvGraphicFramePr->cNvPr)->name,

Check failure on line 1573 in src/PhpSpreadsheet/Reader/Xlsx.php

View workflow job for this annotation

GitHub Actions / phpstan

Variable $twoCellAnchor might not be defined.
];
}
}
Expand Down Expand Up @@ -1806,6 +1809,9 @@ protected function loadSpreadsheetFromFile(string $filename): Spreadsheet
$objChart->setOneCellAnchor($chartDetails[$chartPositionRef]['oneCellAnchor']);
}
}
if (array_key_exists('name', $chartDetails[$chartPositionRef])) {
$objChart->setName($chartDetails[$chartPositionRef]['name']);
}
}
}
}
Expand Down

0 comments on commit ac085bd

Please sign in to comment.