Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate xasis labels #2705

Closed
1 task done
rycks opened this issue Mar 20, 2022 · 1 comment · Fixed by #2940
Closed
1 task done

Rotate xasis labels #2705

rycks opened this issue Mar 20, 2022 · 1 comment · Fixed by #2940
Labels

Comments

@rycks
Copy link

rycks commented Mar 20, 2022

This is:

  • a feature request

What is the expected behavior?

image

What is the current behavior?

label are only "vertical"

@rycks
Copy link
Author

rycks commented Mar 20, 2022

Here is what i have to add to Chart.php

--- ./vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php  2022-03-20 10:35:16.955304094 +0100
+++ /tmp/Chart.php      2022-03-20 10:35:25.359526495 +0100
@@ -479,7 +479,24 @@
         $objWriter->writeAttribute('val', 100);
         $objWriter->endElement();
 
-
+        //erics: add rotation
+        $objWriter->startElement('c:txPr');
+        $objWriter->startElement('a:bodyPr');
+        $objWriter->writeAttribute('rot', "1260000");
+        $objWriter->endElement(); //bodyPr
+        $objWriter->startElement('a:lstStyle');
+        $objWriter->endElement();
+        $objWriter->startElement('a:p');
+        $objWriter->startElement('a:pPr');
+        $objWriter->startElement('a:defRPr');
+        $objWriter->endElement(); //defRPr
+                $objWriter->endElement(); //pPr
+                $objWriter->startElement('a:endParaRPr');
+        $objWriter->writeAttribute('lang', 'en-US');
+        $objWriter->endElement(); //endParaRPr
+            $objWriter->endElement(); //p
+        $objWriter->endElement(); //txPr
+        
             
         if ($isMultiLevelSeries) {
             $objWriter->startElement('c:noMultiLvlLbl');

oleibman added a commit to oleibman/PhpSpreadsheet that referenced this issue Jul 15, 2022
Fix PHPOffice#2705. Add to Axis class, Reader Xlsx Chart, and Writer Xlsx Chart. Add feature to an existing 32* sample, to an existing 33* sample, and a formal unit test.
oleibman added a commit that referenced this issue Jul 17, 2022
Fix #2705. Add to Axis class, Reader Xlsx Chart, and Writer Xlsx Chart. Add feature to an existing 32* sample, to an existing 33* sample, and a formal unit test.
MarkBaker added a commit that referenced this issue Jul 18, 2022
### Added

- Add Chart Axis Option textRotation [Issue #2705](#2705) [PR #2940](#2940)

### Changed

- Nothing

### Deprecated

- Nothing

### Removed

- Nothing

### Fixed

- Fix Encoding issue with Html reader (PHP 8.2 deprecation for mb_convert_encoding) [Issue #2942](#2942) [PR #2943](#2943)
- Additional Chart fixes
  - Pie chart with part separated unwantedly [Issue #2506](#2506) [PR #2928](#2928)
  - Chart styling is lost on simple load / save process [Issue #1797](#1797) [Issue #2077](#2077) [PR #2930](#2930)
  - Can't create contour chart (surface 2d) [Issue #2931](#2931) [PR #2933](#2933)
- VLOOKUP Breaks When Array Contains Null Cells [Issue #2934](#2934) [PR #2939](#2939)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants