Forum


Replies: 1   Views: 807
How can i add a gap between bars on a barchart?
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 RANEPA  · 13-10-2021 - 09:07

I have the following settings of my chart:

'sizeX' => 17,
'sizeY' => 8,
'jc' => 'center',
'chartAlign' => 'center',
'legendPos' => 'l',
'border' => '1',
'type' => 'barChart',
'hgrid' => '1',
'vgrid' => 0,
'color' => '2',
'showValue' => true,

I can't insert image here to show my chart, but the bars on it are side by side, without margings. What property can I add to make spaces between bars?

 

Posted by admin  · 13-10-2021 - 09:35

Hello,

UPDATE: phpdocx 12.5 added the following new feature:
- New options in addChart: gapWidth and overlap for bar and column charts.

 

The current stable release of phpdocx doesn't include an option to change the overlap value (needed to add margins between series such as bars).

This option (and also applying a gap width value to more chart types in addition to Of pie charts) is available in the testing branch and it'll be included in the next stable release (there's no release date yet). You are using an Advanced 11 license; if you upgrade to phpdocx 12+LUS you can access beta and testing features (https://www.phpdocx.com/updates), after you have upgraded your license and included LUS, please send an email to contact[at]phpdocx.com and we'll send you the updated class and a sample to illustrate it.

We also recommend you to check the theme option included in addChart that is available only for Premium licenses. This option doesn't allow setting an overlap value but adds new options to theme charts.

Regards