4 error_reporting(E_ALL);
5 ini_set(
'display_errors', TRUE);
6 ini_set(
'display_startup_errors', TRUE);
7 date_default_timezone_set(
'Europe/London');
9 define(
'EOL',(PHP_SAPI ==
'cli') ?
PHP_EOL :
'<br />');
11 date_default_timezone_set(
'Europe/London');
40 set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
'/../Classes/');
43 include
'PHPExcel/IOFactory.php';
58 'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
60 'at the top of this script as appropriate for your directory structure' 68 if ((isset($argc)) && ($argc > 1)) {
70 for(
$i = 1;
$i < $argc; ++
$i) {
77 $inputFileNameShort = basename($inputFileName);
79 if (!file_exists($inputFileName)) {
80 echo
date(
'H:i:s') ,
" File " , $inputFileNameShort ,
' does not exist' ,
EOL;
84 echo
date(
'H:i:s') ,
" Load Test from $inputFileType file " , $inputFileNameShort ,
EOL;
91 echo
date(
'H:i:s') ,
" Iterate worksheets looking at the charts" ,
EOL;
94 echo
'Worksheet: ' , $sheetName ,
EOL;
97 if(empty($chartNames)) {
98 echo
' There are no charts in this worksheet' ,
EOL;
100 natsort($chartNames);
101 foreach($chartNames as
$i => $chartName) {
103 if (!is_null(
$chart->getTitle())) {
104 $caption =
'"' . implode(
' ',
$chart->getTitle()->getCaption()) .
'"';
106 $caption =
'Untitled';
108 echo
' ' , $chartName ,
' - ' , $caption ,
EOL;
109 echo str_repeat(
' ',strlen($chartName)+3);
110 $groupCount =
$chart->getPlotArea()->getPlotGroupCount();
111 if ($groupCount == 1) {
112 $chartType =
$chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
113 echo
' ' , $chartType ,
EOL;
115 $chartTypes =
array();
116 for(
$i = 0;
$i < $groupCount; ++
$i) {
117 $chartTypes[] =
$chart->getPlotArea()->getPlotGroupByIndex(
$i)->getPlotType();
119 $chartTypes = array_unique($chartTypes);
120 if (count($chartTypes) == 1) {
121 $chartType =
'Multiple Plot ' . array_pop($chartTypes);
122 echo
' ' , $chartType ,
EOL;
123 } elseif (count($chartTypes) == 0) {
124 echo
' *** Type not yet implemented' ,
EOL;
126 echo
' Combination Chart' ,
EOL;
134 $outputFileName = str_replace(
'.xlsx',
'.html', basename($inputFileName));
136 echo
date(
'H:i:s') ,
" Write Tests to HTML file " ,
EOL;
140 echo
date(
'H:i:s') ,
" File written to " , $outputFileName ,
EOL;
147 echo
date(
'H:i:s') ,
' Peak memory usage: ' , (memory_get_peak_usage(
true) / 1024 / 1024) ,
" MB" ,
EOL;
150 echo
date(
'H:i:s') ,
" Done writing files" ,
EOL;
151 echo
'Files have been created in ' , getcwd() ,
EOL;
$rendererName
PHPExcel_IOFactory.
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
static setChartRenderer($libraryName, $libraryBaseDir)
Set details of the external library that PHPExcel should use for rendering charts.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
if($is_dev) echo "Review changes write something in WHATSNEW and and then commit with log PHP_EOL
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(!PHPExcel_Settings::setChartRenderer($rendererName, $rendererLibraryPath)) $inputFileType
Create styles array
The data for the language used.
const CHART_RENDERER_JPGRAPH
Optional Chart Rendering libraries.