Replies: 3   Views: 968
Barchart with autoheight
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by dev@ram  · 26-04-2017 - 15:19


Is there a way by which the barChart height would adjust (increase)automatically to show bars clearly?

I'm having an issue when there are lot of bars and the graph seems to be very congested. Any way to get the height adjusted depending on the number of bars in the graph instead of using fixed height?

Posted by admin  · 27-04-2017 - 08:40


The size of a chart is set by the internal MS WORD wp:extent tag. It doesn't allow to set an 'auto' value, only integer values set as EMUs (English Metric Unit).

phpdocx doesn't include an option to calculate the height depending on the number of bars nor other values.


Posted by dev@ram  · 27-04-2017 - 13:31

Thank you for the confirmation. No problem. When I increase the chart height and if it's bigger than the page it gets clipped off. Is there a way we can make the chart overlap/continue into the next page like a paragraph text?

Posted by admin  · 28-04-2017 - 06:42


Chart elements (w:drawing) don't have the same properties than paragraphs. You can do page breaks before or after the chart, but you can't split it across pages such as paragraphs or tables do.