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

Format axis line #255

Closed
informed-source opened this issue Aug 30, 2016 · 18 comments
Closed

Format axis line #255

informed-source opened this issue Aug 30, 2016 · 18 comments

Comments

@informed-source
Copy link

informed-source commented Aug 30, 2016

Is it possible to format the axis line for a chart in PHPPresentation? Our style requires that there is no visible Y axis line, only the labels.


The $20 bounty on this issue has been claimed at Bountysource.

@Progi1984
Copy link
Member

@informed-source Which type of format do you want to apply to axis (x or y) ?

Note : 

@informed-source
Copy link
Author

Thanks for the prompt response.
In our case we would like the equivalent of Format>Axis>Line>No Line in PowerPoint.
So something like:
getAxisY()->setLine([outline object])
similar to the implementation for Gridlines would work.

@Progi1984 Progi1984 added this to the 0.8.0 milestone Aug 30, 2016
@Progi1984 Progi1984 self-assigned this Sep 14, 2016
Progi1984 added a commit to Progi1984/PHPPresentation that referenced this issue Sep 14, 2016
@Progi1984
Copy link
Member

@informed-source Could you test the PR, please ?

@informed-source
Copy link
Author

Thanks for looking at this. Currently experiencing an issue with 0.7 which I need to resolve.

@informed-source
Copy link
Author

I am unable to get version 0.7 to generate valid PowerPoint files. I have rolled back to my earlier release. I tried updating only the following files:
PhpPresentation/Shape/Chart/Axis.php
PhpPresentation/Writer/PowerPoint2007/PptCharts.php
and I get an error:
PHP Fatal error: Uncaught ReflectionException: Class PhpOffice\PhpPresentation\Writer\PowerPoint2007\PptCharts ... does not exist ...
thrown in
PhpOffice/PhpPresentation/Writer/PowerPoint2007.php on line 115
$o = new \ReflectionClass($class);

@Progi1984
Copy link
Member

@informed-source The writer PowerPoint has changed between 0.6 & 0.7

@informed-source
Copy link
Author

Understood. Version 0.7 does not produce valid PowerPoint files for me.

@Progi1984
Copy link
Member

@informed-source Is it this ticket : #266 ?

@informed-source
Copy link
Author

It may be related. My symptoms are that the output file is either unreadable by PowerPoint on my Mac, or it does not contain the intended content. This is a breaking change since 0.6.

@Progi1984
Copy link
Member

@informed-source Could you test this PR #303 ? Please and thanks for advance

@Progi1984
Copy link
Member

@informed-source The PR #303 has been merged in develop branch. Thanks.

@Progi1984
Copy link
Member

Progi1984 commented Mar 3, 2017

@informed-source Could you test the PR #263 ? Please, I need to merge it :)

@informed-source
Copy link
Author

Tested and working. Thanks.
It was not immediately obvious how to achieve the equivalent of PowerPoint Format>Axis>Line>No Line.
Tried
$oOutlineAxisY->getFill()->setFillType(Fill::FILL_NONE)
but that did not seem to work
Tried
$oOutlineAxisY->setWidth(0);
and that did not appear to work either.
Tried
$oOutlineAxisY->getFill()->getStartColor()->setRGB('FFFFFF');
Which works sets it to the same colour as my background, but is not exactly equivalent to NONE.

Any suggestions?

Also, I noticed that the Axis titles now appear to work, where they did not appear previously.
Is there a better way of suppressing them than
$shape->getPlotArea()->getAxisX()->setTitle('');
?

Thanks again for your continuing work on this.

Progi1984 added a commit to Progi1984/PHPPresentation that referenced this issue Mar 6, 2017
@Progi1984
Copy link
Member

@informed-source I just fixed the

$oOutlineAxisY->getFill()->setFillType(Fill::FILL_NONE);

For the moment, the only way is :

$shape->getPlotArea()->getAxisX()->setTitle('');

Could you test the PR #263 ? Please, I need to merge it :)

@informed-source
Copy link
Author

Excellent. This now works for me:
$oOutlineAxisY->getFill()->setFillType(Fill::FILL_NONE);

Thanks again.

Progi1984 added a commit that referenced this issue Mar 9, 2017
#255 : PowerPoint2007 Writer : Add support for Outline in Axis
@Progi1984
Copy link
Member

Merged in develop branch.

@youssefboudaya
Copy link

is it possible to change the label's color of the axis X and Y when using line chart ?

@Progi1984
Copy link
Member

@youssefboudaya Please create a new issue.

@PHPOffice PHPOffice locked as resolved and limited conversation to collaborators Nov 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants