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

example

  1. <?php
  2.  
  3.  /**
  4.  * Insert a surface 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      2012.12.26
  15.  */
  16.  
  17. require_once '../../classes/CreateDocx.inc';
  18.  
  19. $docx new CreateDocx();
  20.  
  21. $completedData array(
  22.     'legend' => array('Serie 1''Serie 2''Serie 3'),
  23.     'Categoría 1' => array('4.3'2.42),
  24.     'Categoría 2' => array('2.5'4.42),
  25.     'Categoría 3' => array('3.5'1.83),
  26.     'Categoría 4' => array('4.5'2.85),
  27.     'Categoría 5' => array('5'23)
  28. );
  29.  
  30. $paramsChart array(
  31.     'data' => $completedData,
  32.     'type' => 'surfaceChart',
  33.     'legendPos' => 'r',
  34.     'legendOverlay' => false,
  35.     'sizeX' => 10
  36.     'sizeY' => 10,
  37.     'jc' => 'right',
  38.     'color' => 2,
  39.     'border' => 0,
  40.     'hgrid' => 0,
  41.     'vgrid' => 0,
  42.     'font' => 'Times New Roman',   
  43.     'showtable' => true
  44. );
  45. $docx->addChart($paramsChart);
  46.  
  47. $paramsChart array(
  48.     'data' => $completedData,
  49.     'type' => 'surfaceChart',
  50.     'legendPos' => 't',
  51.     'legendOverlay' => true,
  52.     'sizeX' => 10
  53.     'sizeY' => 10,
  54.     'border' => 1,
  55.     'color' => 2,
  56.     'jc' => 'center',
  57.     'wireframe' => true,
  58.     'hgrid' => 1,
  59.     'vgrid' => 1,
  60.     'font' => 'Arial',
  61. );
  62. $docx->addChart($paramsChart);
  63.  
  64. $paramsChart array(
  65.     'data' => $completedData,
  66.     'type' => 'surface3DChart',
  67.     'legendPos' => 'l',
  68.     'sizeX' => 10
  69.     'sizeY' => 10,
  70.     'border' => 3,
  71.     'color' => 3,
  72.     'jc' => 'left',
  73.     'wireframe' => true,
  74.     'hgrid' => 2,
  75.     'vgrid' => 2,
  76. );
  77. $docx->addChart($paramsChart);
  78.  
  79. $paramsChart array(
  80.     'data' => $completedData,
  81.     'type' => 'surface3DChart',
  82.     'legendPos' => 'b',
  83.     'sizeX' => 10
  84.     'sizeY' => 10,
  85.     'color' => 4,
  86.     'border' => 6,
  87.     'wireframe' => false,
  88.     'hgrid' => 3,
  89.     'vgrid' => 3,
  90. );
  91. $docx->addChart($paramsChart);
  92.  
  93. $chart $docx->addElement('addGraphic'$paramsChart);
  94.  
  95. $valuesList array(
  96.     'Line 1',
  97.     $chart,
  98.     'Line 2',
  99.     'Line 3',
  100. );
  101. $paramsList array('val' => 1);
  102. $docx->addList($valuesList$paramsList);
  103.  
  104. $docx->createDocx('../docx/example_chart_surface');

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