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

example

  1. <?php
  2.  
  3. /**
  4.  * Insert a Line 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.4
  15.  */
  16. require_once '../../classes/CreateDocx.inc';
  17.  
  18. $docx new CreateDocx();
  19.  
  20. $lineChartValues array(
  21.     'legend' => array('SymbianOS','iOS','BlackBerry OS','Android''Sony Ericsson','Samsung','Other'),
  22.     '2010-05' => array('32.92''29.01''14.15''3.94''9.09''2.86''1.11'),
  23.     '2010-06' => array('33.39''26.66''14.98''3.95''9.81''3.34''1.07'),
  24.     '2010-07' => array('32.04''26.05''16.45''7.91''6.77''2.93''1.46'),
  25.     '2010-08' => array('31.54''25.71''16.95''9.22''6.16''2.85''1.43'),
  26.     '2010-09' => array('32.69''22.85''17.9''9.79''6.59''2.96''1.16'),
  27.     '2010-10' => array('32.83''22.45''18.19''10.67''5.91''2.83''1.19'),
  28.     '2010-11' => array('31.93''21.94''19.25''11.61''5.32''3.49''1.2'),
  29.     '2010-12' => array('29.66''23.57''18.04''13.6''5.13''4.05''1.2'),
  30.     '2011-01' => array('30.25''25.02''15.03''14.61''5.21''4.33''1.27'),
  31.     '2011-02' => array('30.66''24.56''14.52''15.16''5.14''4.51''1.26'),
  32.     '2011-03' => array('30.61''24.38''14.1''15.8''5.1''4.73''1.21'),
  33.     '2011-04' => array('31.56''23.34''13.54''16.05''5.28''4.99''1.26'),
  34.     '2011-05' => array('31.36''22.09''12.94''17.63''5.77''5.08''1.4')
  35. );
  36.  
  37. $paramsChart array(
  38.     'data' => $lineChartValues,
  39.     'type' => 'lineChart',
  40.     'title' => 'Top 7 Mobile OSs from May 2010 to May 2011',
  41.     'color' => '2',
  42.     'sizeX' => 15,
  43.     'sizeY' => 15,
  44.     'jc' => 'center',
  45.     'groupBar' => 'clustered',
  46.     'font' => 'Arial',
  47.     'hgrid' => 1,
  48.     'vgrid' => 1,
  49.     'legendPos' => 'b',
  50.     'legendOverlay' => 0
  51. );
  52. $docx->addChart($paramsChart);
  53.  
  54. $options array(
  55.     'html' => '<span>Source:  <a href="http://statcounter.com/" class="link_destacado">STATCOUNTER</a></span>');
  56.  
  57. $docx->addHTML($options);
  58.  
  59. $docx->createDocx('../docx/example_chart_line');

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