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

Can't hide axis #1446

Closed
cwolcott opened this issue Apr 17, 2020 · 4 comments
Closed

Can't hide axis #1446

cwolcott opened this issue Apr 17, 2020 · 4 comments

Comments

@cwolcott
Copy link

This is:

- [] a bug report
- [x] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

To be able to fully disable the x and/or y axis from being shown.

What is the current behavior?

Can't be done. Code currently hardcodes axis to always be displayed.

    $objWriter->startElement('c:delete');
    $objWriter->writeAttribute('val', 0);
    $objWriter->endElement();

What are the steps to reproduce?

There is no api interface to control desired outcome.

Which versions of PhpSpreadsheet and PHP are affected?

1.11.0

I plan to submit a pull request that will allow the developer to hide the axis fully. By default the axis is visible.

    $yAxis = new Axis();
    $yAxis->hideAxis();

Before
image

The xl\charts\chart1.xml for the category axis looks like with <c:delete val="0"/>:

<c:catAx><c:axId val="75091328"/><c:scaling><c:orientation val="minMax"/></c:scaling><c:delete val="0"/><c:axPos val="b"/><c:title><c:tx><c:rich><a:bodyPr/><a:lstStyle/><a:p><a:pPr><a:defRPr sz="1400" b="1"/></a:pPr><a:r><a:rPr lang="en-US" sz="1400" b="1"/><a:t>Assay Wells</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/></c:title><c:numFmt formatCode="General" sourceLinked="1"/><c:majorTickMark val="none"/><c:minorTickMark val="none"/><c:tickLblPos val="low"/><c:crossAx val="75089408"/><c:crosses val="autoZero"/><c:auto val="1"/><c:lblAlgn val="ctr"/><c:lblOffset val="100"/><c:noMultiLvlLbl val="0"/></c:catAx>

After
image

The Xlsx/Charts.php will now dynamically generate the delete tag based on the axis configuration.

@cwolcott cwolcott mentioned this issue Apr 17, 2020
5 tasks
@cwolcott
Copy link
Author

I have submitted a pull request and failed because of - scrutinizer.test_coverage, < 0 # Code Coverage decreased from previous inspection by 0.011%.

Can someone let me know what I need to do to get this pass the check.

@stale
Copy link

stale bot commented Jun 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Jun 17, 2020
@MarkBaker MarkBaker removed the stale label Jun 17, 2020
@stale
Copy link

stale bot commented Aug 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Aug 16, 2020
@stale stale bot closed this as completed Aug 23, 2020
@oleibman
Copy link
Collaborator

Equivalent functionality was added by PR #2950 in July 2022.

@oleibman oleibman removed the stale label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants