开发者

Create Excel chart programmatically in PHP

Do you have any idea on how to create a chart in an Excel sheet programmatically from PHP ?

I know you can invoke the Excel COM object, but the server is ru开发者_如何转开发nning on a Linux machine...

I already use the excellent PHPExcel library but they do not offer the option to create charts.

Thanks !


Give Google Charts API a go.

Aonther option you could look at is RRD tool, see here

HTH


I think it's not a bad idea to use PHPs GD library like these

WS Charts

Bar graph tutorial

or JpGraph, I'm not sure of the internals but there is free PHP5 and PHP4 versions available


Google Charts is a nice idea. I would use built-in PHP draw functions to generate a chart, though.


I don't believe that using Excel is the best way of generating a chart. Typically, with ASP.net, you would either write your own chart rendering, or you would use an external component to do this (liberal definition).

My suggestions:

  1. Pipe the data into gnuplot, customize it and grab the output
  2. Get a third party widget to send the data into and handle the user interaction (Highly recommended)
  3. Write your own chartting control (free from licensing issues, but not worth the annoyances unless you really like doing graphics your self)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜