create
[ class tree: create ] [ index: create ] [ all elements ]

example

  1. <?php
  2.  
  3. /**
  4.  * Insert a doughnut chart into a Word document.
  5.  *
  6.  * @category   Phpdocx
  7.  * @package    examples
  8.  * @subpackage easy
  9.  * @copyright  Copyright (c) 2009-2013 Narcea Producciones Multimedia S.L.
  10.  *              (http://www.2mdc.com)
  11.  * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
  12.  * @version    2012.12.26
  13.  * @link       http://www.phpdocx.com
  14.  * @since      File available since Release 2.7
  15.  */
  16.  
  17. require_once '../../classes/CreateDocx.inc';
  18.  
  19. $simpleData array(
  20.     'legend' => array('Simple Data'),
  21.     'data 1' => array('10'),
  22.     'data 2' => array('20'),
  23.     'data 3' => array('50'),
  24.     'data 4' => array('25')
  25. );
  26. $docx new CreateDocx();
  27.  
  28. $paramsChart array(
  29.     'data' => $simpleData,
  30.     'type' => 'doughnutChart',
  31.     'title' => 'Most Simple doughnut Chart with simple data',
  32.     'font' => 'Times New Roman',
  33.     'showPercent' => true,
  34.     'showValue' => true,
  35.     'showCategory' => true,
  36.     'explosion' => 25,
  37.     'border' => 3,
  38.     'holeSize' => 25,
  39.     'sizeX' => 15,
  40.     'sizeY' => 15,
  41.     'jc' => 'right',
  42.     'color' => '2',
  43.     'legendPos' => 'r',
  44.     'legendOverlay' => true,
  45.     'showtable' => true,
  46.     'hgrid' => 2,
  47.     'vgrid' => 2,
  48.     'showtable' => true,
  49. );
  50. $docx->addChart($paramsChart);
  51.  
  52. $paramsChart array(
  53.     'data' => $simpleData,
  54.     'type' => 'doughnutChart',
  55.     'title' => 'Most Simple doughnut Chart with simple data',
  56.     'showPercent' => true,
  57.     'jc' => 'center',
  58.     'color' => '2',
  59.     'font' => 'Arial',
  60.     'legendPos' => 't',
  61. );
  62. $chart $docx->addElement('addGraphic'$paramsChart);
  63. $valuesList array(
  64.     'Line 1',
  65.     $chart,
  66.     'Line 2',
  67.     'Line 3',
  68. );
  69. $paramsList array('val' => 1);
  70. $docx->addList($valuesList$paramsList);
  71.  
  72. $docx->createDocx('../docx/example_chart_doughnut');

Documentation generated on Mon, 13 Jan 2014 13:44:05 +0100 by phpDocumentor 1.4.4