Forum


Replies: 2   Views: 2599
Lower border clipping off for charts?
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  · 13-10-2017 - 07:06

Hello,

We have tested it and we see all borders opening the DOCX with MS Word 2007, MS Word 2010, MS Word 2013, MS Word 2016 and LibreOffice 5 (https://s1.postimg.org/5d3tcr2q67/chart_borders.jpg).

What program and version are you using to open the DOCX? Maybe you can do a break line after each chart to add a line to separate each chart.

This is the code we have run, please check and test it:

<?php

require_once 'classes/CreateDocx.inc';

$docx = new CreateDocx();

$data = array(
    'legend' => array('Legend 1', 'Legend 2', 'Legend 3'),
    'data 1' => array(9, 7, 5),
    'data 2' => array(2, 6, 3),
    'data 3' => array(5, 3, 7)
);
$paramsChart = array(
    'data' => $data,
    'type' => 'barChart',
    'color' => '5',
    'title' => 'my title',
    'sizeX' => '17',
    'legendPos' => 'none',
    'border' => '1',
    'vgrid' => 0,
    'hgrid' => 1,
    'scalingMin' => '0.0',
    'scalingMax' => '10',
    'majorUnit' => 1.0,
    'minorUnit' => 0.0,
    'showValue' => true,
    'chartAlign' => 'left',
    'showTable' => false,
    'font' => "Arial",
    'groupBar' => 'clustered',
);
$docx->addChart($paramsChart);

$data = array(
    'legend' => array('Legend 1', 'Legend 2', 'Legend 3'),
    'data 1' => array(7, 5, 8),
    'data 2' => array(3, 1, 4),
    'data 3' => array(3, 3, 5)
);
$paramsChart = array(
    'data' => $data,
    'type' => 'barChart',
    'color' => '5',
    'title' => 'my title',
    'sizeX' => '17',
    'legendPos' => 'none',
    'border' => '1',
    'vgrid' => 0,
    'hgrid' => 1,
    'scalingMin' => '0.0',
    'scalingMax' => '10',
    'majorUnit' => 1.0,
    'minorUnit' => 0.0,
    'showValue' => true,
    'chartAlign' => 'left',
    'showTable' => false,
    'font' => "Arial",
    'groupBar' => 'clustered',
);
$docx->addChart($paramsChart);

$docx->createDocx('output');

Regards.