Forum


Replies: 2   Views: 2926
Axis labels overlay on top of axis values - which parameter is wrong
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 admin  · 19-12-2016 - 08:28

Hello,

To hide the legend, please use legendPos (this is P, not p).

About the overlay of the axis title, phpdocx doesn't allow to control it and set it in the default position (may overlap the axis). To fix this, please edit the file CreateGraphic.inc and in the generateAXLABEL method add this tag:

<c:overlay val="0"/>

after </c:tx>.

This is the current method:

protected function generateAXLABEL($val = 'Axis title')
{
  $xml = '<' . CreateGraphic::NAMESPACEWORD . ':title><c:tx><c:rich>' .
                '__GENERATEBODYPR__<a:lstStyle/><a:p><a:pPr><a:defRPr/></a:pPr>' .
                '<a:r><a:t>' . $val . '</a:t></a:r></a:p></c:rich></c:tx>' .
                '</' . CreateGraphic::NAMESPACEWORD . ':title>__GENERATEAX__';
  $this->_xmlChart = str_replace(
                '__GENERATEAX__', $xml, $this->_xmlChart
  );
}

And this is the method after adding the new tag:

protected function generateAXLABEL($val = 'Axis title')
{
  $xml = '<' . CreateGraphic::NAMESPACEWORD . ':title><c:tx><c:rich>' .
                '__GENERATEBODYPR__<a:lstStyle/><a:p><a:pPr><a:defRPr/></a:pPr>' .
                '<a:r><a:t>' . $val . '</a:t></a:r></a:p></c:rich></c:tx><c:overlay val="0"/>' .
                '</' . CreateGraphic::NAMESPACEWORD . ':title>__GENERATEAX__';
  $this->_xmlChart = str_replace(
                '__GENERATEAX__', $xml, $this->_xmlChart
  );
}

We have added a task to add this change in the master branch of the library.

Regards.