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

example

  1. <?php
  2.  
  3. /**
  4.  * Insert a bubble 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. $completedData array(
  20.     array(1001),    
  21.     array(1522),    
  22.     array(2043),    
  23.     array(2564),    
  24. );
  25.  
  26. $docx new CreateDocx();
  27.  
  28. $paramsChart array(
  29.     'data' => $completedData,
  30.     'type' => 'bubbleChart',
  31.     'title' => 'simple bubbles',
  32.     'legendPos' => 't',
  33.     'color' => 2,
  34.     'border' => 1,
  35.     'font' => 'Times New Roman',
  36.     'hgrid' => '2',
  37.     'vgrid' => '2',
  38.     'showPercent' => true,
  39.     'showValue' => true,
  40.     'showCategory' => true,
  41.     'showtable' => true
  42. );
  43. $docx->addChart($paramsChart);
  44.  
  45. $paramsChart array(
  46.     'data' => $completedData,
  47.     'type' => 'bubble3DChart',    
  48.     'title' => '3D bubbles',
  49.     'rotX' => 20'rotY' => 20'perspective' => 30,
  50.     'border' => 3,
  51.     'font' => 'Arial',
  52.     'color' => 3,
  53.     'legendPos' => 'none',
  54.     'jc' => 'right',
  55.     'haxLabel' => 'label horizontal',
  56.     'vaxLabel' => 'label vertical',
  57.     'haxLabelDisplay' => 'horizontal',
  58.     'vaxLabelDisplay' => 'horizontal',
  59.     'hgrid' => '1',
  60.     'vgrid' => '1',
  61.     'showPercent' => true,
  62.     'showValue' => true,
  63.     'showCategory' => true,
  64. );
  65. $docx->addChart($paramsChart);
  66.  
  67. $chart $docx->addElement('addGraphic'$paramsChart);
  68. $valuesList array(
  69.     'Line 1',
  70.     $chart,
  71.     'Line 2',
  72.     'Line 3',
  73. );
  74. $paramsList array('val' => 1);
  75. $docx->addList($valuesList$paramsList);
  76.  
  77. $docx->createDocx('../docx/example_chart_bubble');

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