# example

1. <?php
3. /**
4. * Inserts a col and a bar chart into a Word document.
5. *
6. * @category Phpdocx
7. * @package examples
8. * @subpackage easy
9. * @copyright Copyright (c) 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 3.0
13. * @link http://www.phpdocx.com
14. * @since File available since Release 3.0
15. */
16. require_once '../../classes/CreateDocx.inc';
18. $docx = new CreateDocx();
20. $colChartValues = array(
21. 'legend' => array('Internet Explorer'),
22. 'January 2011' => array('26.6'),
23. 'February 2011' => array('26.5'),
24. 'March 2011' => array('25.8'),
25. 'April 2011' => array('24.3'),
26. 'May 2011' => array('24.9'),
27. 'June 2011' => array('23.2')
28. );
30. $paramsChart = array(
31. 'data' => $colChartValues,
32. 'type' => 'barChart',
33. 'title' => 'W3C Browser Statistics',
34. 'color' => 2,
35. 'sizeX' => 15,
36. 'sizeY' => 15,
37. 'jc' => 'center',
39. );
41. $docx->addChart($paramsChart);
43. $paramsChart = array(
44. 'data' => $colChartValues,
45. 'type' => 'colChart',
46. 'title' => 'W3C Browser Statistics',
47. 'color' => 2,
48. 'sizeX' => 15,
49. 'sizeY' => 15,
50. 'jc' => 'center',
52. );
54. $docx->addChart($paramsChart);
56. $docx->createDocx('../docx/example_chart_bar');

Documentation generated on Tue, 21 May 2013 17:19:47 +0200 by phpDocumentor 1.4.4