5ini_set(
'display_errors', TRUE);
6ini_set(
'display_startup_errors', TRUE);
7date_default_timezone_set(
'Europe/London');
9define(
'EOL',(PHP_SAPI ==
'cli') ?
PHP_EOL :
'<br />');
11date_default_timezone_set(
'Europe/London');
40set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) .
'/../Classes/');
43include
'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'
68if ((isset($argc)) && ($argc > 1)) {
70 for($i = 1; $i < $argc; ++$i) {
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;
150echo
date(
'H:i:s') ,
" Done writing files" ,
EOL;
151echo
'Files have been created in ' , getcwd() ,
EOL;
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
$rendererName
PHPExcel_IOFactory.
memory_get_peak_usage(true)/1024/1024)
if(!PHPExcel_Settings::setChartRenderer($rendererName, $rendererLibraryPath)) $inputFileType
An exception for terminatinating execution or to throw for unit testing.
static createWriter(PHPExcel $phpExcel, $writerType='')
Create PHPExcel_Writer_IWriter.
static createReader($readerType='')
Create PHPExcel_Reader_IReader.
static setChartRenderer($libraryName, $libraryBaseDir)
Set details of the external library that PHPExcel should use for rendering charts.
const CHART_RENDERER_JPGRAPH
Optional Chart Rendering libraries.