mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-18 10:40:35 +00:00
Upgrade chart rendering support to be composer based
This allow to get rid of manual class loading and have simpler usage of the library.
This commit is contained in:
@@ -6,16 +6,7 @@ use PhpOffice\PhpSpreadsheet\Settings;
|
||||
require __DIR__ . '/../Header.php';
|
||||
|
||||
// Change these values to select the Rendering library that you wish to use
|
||||
// and its directory location on your server
|
||||
$rendererName = Settings::CHART_RENDERER_JPGRAPH;
|
||||
$rendererLibrary = 'jpgraph3.5.0b1/src/';
|
||||
$rendererLibraryPath = '/php/libraries/Charts/' . $rendererLibrary;
|
||||
|
||||
if (!Settings::setChartRenderer($rendererName, $rendererLibraryPath)) {
|
||||
$helper->log('NOTICE: Please set the $rendererName and $rendererLibraryPath values at the top of this script as appropriate for your directory structure');
|
||||
|
||||
return;
|
||||
}
|
||||
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
|
||||
|
||||
$inputFileType = 'Xlsx';
|
||||
$inputFileNames = __DIR__ . '/../templates/36write*.xlsx';
|
||||
@@ -86,7 +77,7 @@ foreach ($inputFileNames as $inputFileName) {
|
||||
}
|
||||
|
||||
// Save
|
||||
$filename = $helper->getFilename($inputFileName);
|
||||
$filename = $helper->getFilename($inputFileName, 'html');
|
||||
$writer = IOFactory::createWriter($spreadsheet, 'Html');
|
||||
$writer->setIncludeCharts(true);
|
||||
$callStartTime = microtime(true);
|
||||
|
||||
Reference in New Issue
Block a user