Replies: 2   Views: 1615
'legendpos' => 'none' in addchart causes an error
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 Siegfried  · 20-12-2019 - 14:26


my phpdocx version is 9.5

I created a chart with $wordfragment->addChart and uses the theme-options.
Also I set the parameter 'legendPos' =>  'none',
and get an error:

Notice: Trying to get property 'ownerDocument' of non-object in D:\Webpages\wwwroot_proqualistool_v2\Applikation\phpdocx\classes\ThemeCharts.php on line 83

'legendPos' =>  'r' works fine!

Please help and best regards


Posted by admin  · 20-12-2019 - 20:36


The Premium package includes the following samples that set legendPos as 'none': sample_2.php and sample_16.php.

It seems your code is seting legendPos as 'none', so no legend tag is created, and you are trying to set a legend style using the legendArea option. You can't apply a legend style as the legend tag doesn't exist, so phpdocx returns a not found DOM exception.

To hide elements in charts please check the show* options available in the addChart method.


Posted by Siegfried  · 15-01-2020 - 16:46

Thanks, yes this was the mistake.

I did'nt remove the background-color for the "legendArea"-Parameter from the theme-options.

Now it works!