How to Create Bar chart using PHPExcel

Topics: Developer Forum, Project Management Forum, User Forum
Jan 4, 2012 at 11:28 AM


Currently i am using this opensource for the creation of different XLS sheet with proper formation of Data / Records, Now we have requirement to create Bar Chart using that records as well as using PHPExcel open source coding into the created Sheet.

So please provide me some guidence how to create programming to embed Chart with in XLS sheet which is made by different records / data .

Hope will get some reply soon.

Thanks & Regards,

Nayan Jogi



Jan 4, 2012 at 4:18 PM


At the moment is not possible with PHPExcel to use Chart, so i recoment is the library called pChart google it and you going to find many info and examples...

What i do with pchart is to create an .jpg with the info and then i add the .jpg to my excel that i generate with PHPExcel.

Mar 14, 2012 at 3:30 PM


I have done a pChart graph and I'd like to render it:


And then import to a PHPExcel's drawing:


Both declarations are in the same file data_to_excel.php. When I separate them, they works, but in the one file $objDrawing could not see the picture pointed in the path and shows an error. I don't know what I am doing wrong. Could someone help me? Is there any different way to export directly a chart from pChart to the PHPExcel's spreadsheet?

Thanks & Regards,