Is it possible to create chart via PHPEXEL ?

Topics: Developer Forum
Jun 20, 2011 at 1:25 PM

Hi,  I need to add chatrs to exel I generate via PHPEXEL. Are there any functions or I should draw chart as GD image and then add it sheet ?

Something like this ?


// Generate an image

$gdImage = @imagecreatetruecolor(120, 20) or die('Cannot Initialize new GD image stream');
$textColor = imagecolorallocate($gdImage, 255, 255, 255);
imagestring($gdImage, 1, 5, 5, 'Created with PHPExcel', $textColor);

// Add a drawing to the worksheet

$objDrawing = new PHPExcel_Worksheet_MemoryDrawing();
$objDrawing->setName('Sample image');
$objDrawing->setDescription('Sample image');

With best regards Igor


Jun 22, 2011 at 9:25 PM

they are working on chart support, many are waiting for that update here, im the first one.... but there is another library that you can use for that pChart.

This one create a Chart with the parameters that you provide and it creates an Image, and that image you include it in you excel. so thats what you want.

Sorry i didnt read the rules of the forum ;-), i dont know if we can mention other libraries here.

Jun 22, 2011 at 10:17 PM

Thank you for help