|
|
when I use my own excle file , then the save file will be open without chart ( error of some part missing in excle ) .
when I use examples .xlsx file every thing is fine , just the colors which i set will change . and colors are very important for me 'cause my chart want's to show 4 color result . and it's funny for red result it's blue , ... .
please help
|
|
|
|
I attached the result xlsx file
|
|
|
|
are you inserting colors caring of alpha channel? are you using setARGB passing only RGB values? Please write sample code..
|
|
|
|
I don't know anything about that . i used the code in sample ( just open write sth and save) . pls give me more info
|
|
|
|
require_once 'Classes/PHPExcel.php';
/** PHPExcel_IOFactory */
include 'Classes/PHPExcel/IOFactory.php';
$today = date("Ymd");
$target ='Results/';
$fileType = 'Excel2007';
$InputFileName = $target.'Result.xlsx';
$OutputFileName = $target. $today . '_Result.xlsx';
//Read the file (including chart template)
$objReader = PHPExcel_IOFactory::createReader($fileType);
$objReader->setIncludeCharts(TRUE);
$objPHPExcel = $objReader->load($InputFileName);
//Change the file
$objPHPExcel->setActiveSheetIndex(0)
// Add data
->setCellValue('C3','10' )
->setCellValue('C4','20' )
->setCellValue('C5','30')
->setCellValue('C5','40' );
//Write the file (including chart)
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $fileType);
$objWriter->setIncludeCharts(TRUE);
$objWriter->save($OutputFileName);
|
|