-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Added the ability to enable gridlines and axislabels on charts #576
Conversation
added options 'showAxisLabels', 'showGridX', 'showGridY' to charts style element
removed whitespace changed inline if statement
Any chance to add the function "Add Data Labels" to Pie charts? |
@okrauth: I`m not sure, for Pie Charts it is not working at the moment, maybe you can unpack a word doc with a Pie-Chart where the labels were created directly in Word. Then search for that labels in the xml files. Then you will see what you have to add to the PHPWord code to generate the correct XML Parts for PieChart labels. The Pie-Chart behaves somewhat different. |
How to actually do this? Can't get it to work. any snippet? |
@betocantu93 |
Im making several charts, like 300, so I need to label, use grids, and titles, I couldn't find a way to do it... Tried everything... —You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub |
Line charts only, I need to add some labels and a grid, with axis labels |
@FrankMeyer : I unpacked a docx did a comparison and noticed that in order to add a leyend to a pie chart one needs to add the following code to the xml chat.xml document:
Not sure how to accomplish this (which document to edit in the php library... can you point me in the right direction? thanks |
@okrauth: The charts are contructed in the file PhpWord/Writer/Word2007/Part/Chart.php. |
@FrankMeyer Thank you. It looks like it is embedded at '<c:chart>' ' <c:legend><c:legendPos val="r"/><c:layout/><c:overlay val="0"/>/c:legend <c:plotVisOnly val="1"/><c:dispBlanksAs val="zero"/><c:showDLblsOverMax val="1"/>/c:chart<c:spPr><a:ln><a:noFill/>/a:ln/c:spPr/c:chartSpace' |
then you should add the legend part in this function: private function writeChart(XMLWriter $xmlWriter) |
@FrankMeyer will do... thanks |
I'm looking to add Legend
Axes
Gridlines
Data Labels
Has this been implemented or because of the failed travis and scrutinzer checks it wasn't implemented? |
The checks have not run correctly at that time, I just don't have the permissions to rerun travis and scrutinizer. They may succeed. |
FYI I've added some comments on how to get data labels options and axis options to be outputted here #957 |
help add Show Value in Piechart
I'm not successful |
@scalco19 You should read @phpdave 's thread #957 ! If you already read it try following in src/PhpWord/Writer/Word2007/Part/Chart.php in the writeSeries() method:
Works like a charm for me, but I am using $chartOptions as mentioned in #957 |
other features in #957 |
Added options 'showAxisLabels', 'showGridX', 'showGridY' to charts style element.
Added appropriet set and get methods.
Those options can be testet in Sample_32_Charts.php, but they are set to false for now.
Default output of that sample is not changed.