This project has moved and is read-only. For the latest updates, please go here.

Implement chart functionality


Implement chart functionality
  • Milestone 1: Simple column chart, included in Excel2007 writer

file attachments


fks wrote Jun 19, 2007 at 5:35 PM

this would be a great feature!a functionality that allows creating simple bar and pie charts :-)

wrote Jun 20, 2007 at 12:39 PM

wrote Jun 24, 2007 at 10:40 AM

wrote Aug 23, 2007 at 8:38 AM

wrote Sep 3, 2007 at 10:44 AM

wrote Sep 14, 2007 at 12:17 PM

wrote Oct 23, 2007 at 9:35 AM

wrote Nov 15, 2007 at 9:34 AM

Thymus wrote Nov 15, 2007 at 9:37 AM


Could we have some news about this functionnality ?

I need to create Pie and bar charts

Thanks a lot dear belgian developper (I'm also belgian) ;)


maartenba wrote Nov 15, 2007 at 1:55 PM

It is actually quite a lot of work to implement this one in a flexible manner. And as I'm quite busy these days... Would you be interested in contributing?

wrote Dec 17, 2007 at 8:34 PM

retiolum wrote Mar 26, 2008 at 3:59 PM

I've done some pretty nice graph drawing recently using the graph component from ezComponents (; therefore I created the graph, rendered it to a temporary file and added it afterwards to the Excel sheet. It works pretty fine (except that the included graphics don't show up in OpenOffice).

wrote Apr 29, 2008 at 11:31 PM

b166er wrote May 17, 2008 at 11:54 AM

hi, i'm also afraid to hear about this issue.
but how about to use JpGraph ( instead of ezComponents?
because i think its pretty neutral.
but it's only my position.


wrote May 18, 2008 at 8:35 PM

wrote May 19, 2008 at 12:05 PM

wrote May 23, 2008 at 7:45 AM

wrote Jul 1, 2008 at 1:56 PM

wrote Aug 1, 2008 at 12:56 PM

wrote Aug 2, 2008 at 9:48 AM

wrote Aug 12, 2008 at 7:32 AM

wrote Aug 15, 2008 at 8:52 PM

wrote Aug 29, 2008 at 8:20 AM

maecka wrote Sep 15, 2008 at 12:52 PM

I have started to work on this.

wrote Sep 15, 2008 at 12:52 PM

wrote Sep 29, 2008 at 2:39 PM

General_Luzi wrote Oct 1, 2008 at 9:58 AM

Could someone give me a statement about the schedule of this feature please?

wrote Nov 25, 2008 at 10:03 PM

wrote Nov 26, 2008 at 6:24 PM

wrote Dec 3, 2008 at 12:34 AM

wrote Mar 2, 2009 at 3:21 PM

wrote Mar 4, 2009 at 8:50 PM

wrote Mar 23, 2009 at 6:47 PM

wrote Mar 24, 2009 at 6:27 PM

zero007 wrote Mar 30, 2009 at 9:01 PM

I'd like to know when this feature will be available...
I need to read from a file several data, maybe change it. Included in this data there's a chart that is dependent on these data. I don't need to modify this graph, only the data and the graph should modify whit this updated data.
make this question to see if this new implementation wolud include this feature, or i just look in some other place

Other cuestion, where i can get information of excel document structure in case i could develop something like this.. ??


maartenba wrote Mar 31, 2009 at 7:02 AM

We're working on it, no estimated dtae of completion. File format docs are available at

zero007 wrote Mar 31, 2009 at 12:35 PM

OK, thanks for answering. I keep up to date...
This feature, will cover the example that i wrote before?
Great library, and sorry for the inconvenience

wrote Mar 31, 2009 at 12:38 PM

wrote Apr 23, 2009 at 3:59 AM

wrote Jun 15, 2009 at 7:48 PM

wrote Jun 22, 2009 at 6:46 PM

wrote Jul 14, 2009 at 11:11 AM

wrote Feb 3, 2010 at 9:05 AM

jackue wrote Feb 4, 2010 at 10:48 AM


I work on a project which use phpexcel. I need to insert a chart into excel. The chart will be updated while i modify the data. At the moment, i use PHP COM for it. But it works only under Windows + Office MS. That means that it will not work on the linux server. So if this fonctionnality will be added in PHPExcel, i wish that it could work on linux. That's just a wish.


MarkBaker wrote Feb 4, 2010 at 10:55 AM

It's ongoing development at the moment, but I'm not prepared to commit to any timescales
When we do make it available, it won't matter what operating system you're running on. The point of PHPExcel is that it's pure PHP, making it cross-platform, rather than dependent on OS-specific plug-ins or features

wrote Jun 18, 2010 at 3:31 PM

wrote Jul 23, 2010 at 8:43 PM

Manash082 wrote Sep 21, 2010 at 8:42 AM

Just need to know whether showing chart in excel sheet using PHP Excel has come in to picture or still in cards.If this functionality is available now,do send me some link where I'll get to know more about this particular feature.

Thanking you in advance,

MarkBaker wrote Sep 21, 2010 at 1:58 PM

Target for the initial release of charting is the next release of PHPExcel (1.7.5) sometime in October/November, when I hope to have charts implemented for the Excel2007 Reader and Writer, some basic methods for creating/editing charts, and options for rendering a gif/jpg image from a chart definition using a configurable 3rd party library such as jpGraph.

Currently I have the basis of:
  • Column and Bar - Grouped, Stacked and Percentage in both 2 and 3D
  • Line and Area - Stacked and Percentage (with/without markers for lines) ... no 3D yet
  • Pie and Pie 3D (including exploded)
  • Doughnut and Exploded Doughnut
  • Scatter - with line or bezier join (with/without markers) but not yet true scatter without any joining line
  • Radar
  • Bubble chart - 2d only at present
  • Contour/Wireframe/Surface - absolute basics only
  • Legends, Titles, and x/y-axes with labels (but not multiple axes)
  • No backgrounds
  • No Stock charts yet
Other readers/writers and other rendering libraries (Graphpite would be my second choice) to follow in subsequent releases. I'm looking to target OOCalc and Gnumeric Readers/Writers after the initial Excel2007 Readers/Writers.... mainly because they're a very similar XML structure and should be straightforward to write.

Manash082 wrote Oct 6, 2010 at 11:24 AM

thanks for your quick reply.But I have one more query.

Well Mark you have mentioned that there are certain charts available.Well that's great but I didn't find any help regarding implementing chart using PHP Excel.I am saying about the coding helps.In the developer documentation also no such things are specified.
Can you please tell me from where I can get help regarding how to generate chart using PHP Excel?

Or the documentation for generating chart will be included when the whole functionality will come in to picture that is in the next release.

Please do clarify.

maartenba wrote Oct 12, 2010 at 7:59 PM

Mark, is this checked in somewhere? I want to make everything regarding charts in PHPExcel and PHPPowerPoint as similar as possible. Looks like a good feature set already! Keep up the good work :-)

wrote Nov 9, 2010 at 2:57 PM

wrote Nov 22, 2010 at 11:21 PM

wrote Nov 30, 2010 at 2:32 PM

wrote Dec 6, 2010 at 8:55 PM

wrote Dec 20, 2010 at 10:54 AM

wrote Dec 20, 2010 at 5:15 PM

wrote Jan 18, 2011 at 4:19 PM

wrote Jan 24, 2011 at 7:28 AM

wrote Feb 17, 2011 at 3:02 PM

wrote Feb 21, 2011 at 7:33 PM

wrote Apr 1, 2011 at 10:32 PM

wrote Apr 3, 2011 at 3:55 PM

wrote Jun 21, 2011 at 10:48 AM

wrote Aug 12, 2011 at 9:02 AM

marek_zebrowski wrote Aug 12, 2011 at 9:02 AM

I came across the same problem - I needed charts in PHPExcel. What I did is I ported some changes from charts (wi16-graph branch) to work in 1.7.6 code.
It worked for OpenOffice but not for excel. I did some more research, learnt how much brain-damaged OpenXML is []
and produced something that works (at least with excel2010)
It's not complete, it only allows to save charts.
How to use:
  1. you have to have a chart template prepared (just create chart in excel and extract xl/charts/chart1.xml file).
    $objDrawing = new PHPExcel_Worksheet_ChartDrawing();
    $objDrawing->setTemplate($template); //$template is string with original chart contents

    // set some data
    $objDrawing->setDataset($dataRange="B1:B10",$dataArray); //$dataArray should have actual array values
    // set cooridnates - must set both as positioning uses twoCellAnchor
And thats all. I apologize for ugly code, but that was all functionality I needed at this time. Some things I got right though:
  1. Excel really needs calcChain.xml, so I generate one (PHPExcel_Writer_Excel2007_ContentTypes, PHPExcel_Writer_Excel2007_Rels,PHPExcel_Writer_Excel2007)
  2. Charts needs its own relations and content types (PHPExcel_Writer_Excel2007, PHPExcel_Writer_Excel2007_ContentTypes, PHPExcel_Writer_Excel2007_Rels)
  3. twoCell anchor works better for chart positioning that oneCellAnchor (PHPExcel_Writer_Excel2007_Drawing, PHPExcel_Worksheet_BaseDrawing)
That patch is not a complete solution but some parts of it may be a start for future work.

Mike_SEO wrote Aug 22, 2011 at 5:03 PM

That patch looks promising. I want to try it out but am struggling to apply the patch. Could you (or someone else) provide pre-patched versions?



wrote Aug 22, 2011 at 10:54 PM

Wanted wrote Oct 17, 2011 at 9:19 PM

Hello to all, this is my first comment on PHPExcel :)
This PHPExcel is very nice and the possibility to make charts will be very usefull.
I work on 1.7.6. There is the possibility to apply the patch on this version?
Or i have to download the wi16-graph branch entirely?
What is the version on the wi16-graph branch is based?

Thanks to all.

wrote Oct 17, 2011 at 9:19 PM

wrote Dec 16, 2011 at 6:23 AM

pchclininfo wrote Dec 16, 2011 at 6:27 AM

I tried to applied the patch but I do not find the PHPExcel_Writer_Excel2007_CalcChain classe.
Is there a way to get it ?
Thanks in advance

wrote Feb 28, 2012 at 12:09 AM

ujin_z wrote Apr 26, 2012 at 9:24 AM

I'm testing chart functionality on changeset 89095 and found some "errors".

function refresh on PHPExcel/Chart.php:
$this->$_plotArea...... should be $this->_plotArea.....

function _charttitle on PHPExcel/Reader/Excel2007/Chart.php:
gives me an error -> Node no longer exists

function _writePlotSeriesValues on PHPExcel/Writer/Excel2007/Chart.php:
$plotSeriesValues->getDataValues() returns -> "Sheet1!$B10:$B26" instead of an array of values.

function _writeTitle on PHPExcel/Writer/Excel2007/Chart.php:

doesn't check if $caption array has values, only checks if is an array

wrote Apr 26, 2012 at 9:25 AM

wrote Jul 15, 2012 at 8:32 PM

wrote Sep 9, 2012 at 5:58 PM

VAshot wrote Feb 6, 2013 at 12:27 PM

Can I have a scatter chart (x - A1: A10, y - B1: B100)?
Are there any ways? Using the template .xlsx, get an error when opening .xlsx in Excell.

wrote Feb 22, 2013 at 3:05 AM

wrote Nov 28 at 6:26 AM