4

I'm looking for suggestions on creating graphs with PHP. I would also like to be able to export these graphs to a PDF document.

I am currently using google graphs but I don't like the idea of sending all my information to Google. I'd prefer my own in hosted solution.

I have seen a lot of Flash solutions but i'm not aware of any way to export the SWF's to PDF.

Any pointers greatly appreciated.

Thanks.

jim
  • 8,670
  • 15
  • 78
  • 149
  • Is there more stuff in the PDF, or just the picture? If it's just a picture in a PDF, why not just use the picture? – Svish Apr 07 '11 at 13:35
  • Hi Guys, Thanks for the replies. These graphs will be part of a larger report so there will be more content in the pdf. I am currently looking into RGraph [link](http://www.rgraph.net/) which are generated using the HTML5 canvas element. My question is, will I be able to include these graphs in a PDF that is created with a library like TCPDF? Thanks. – jim Apr 08 '11 at 14:59
  • Hi, started off using Google Charts as thats what my app already used. I find it awful to work with tbh. I've gone with Open Flash Charts 2 and SVGGraph, i'm quiet happy with the results, thanks – jim Apr 27 '11 at 20:25

7 Answers7

5

Lot of tools like PHPGraphLib, JPGraph this both produce images that you can embedd into pdfs

MiPnamic
  • 1,257
  • 10
  • 18
3

Could something like SVGGraph plus SVG to PDF work?

Community
  • 1
  • 1
Svish
  • 152,914
  • 173
  • 462
  • 620
1

We make pdf reports on the fly. These documents have both text and pictures. The pdf is made with TCPDF and the pictures with php GD library. Both library's are free.

PeblCode
  • 11
  • 1
0

one of the best graph api library is Rgraph.

streak
  • 1,121
  • 1
  • 19
  • 28
0

If you wanted to explore the flash avenue, you could check out http://alivepdf.bytearray.org/ an open pdf library for AS3.

Sam
  • 1,233
  • 1
  • 9
  • 16
0

You can use Javascript, Highcharts is free for non-commercial usage. And it has PDF export options too.

Highcharts is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application. Highcharts currently supports line, spline, area, areaspline, column, bar, pie and scatter chart types http://www.highcharts.com/

Cogicero
  • 1,514
  • 2
  • 17
  • 36
-1

I've used the Google Charts API before and inserted them into pdfs using FPDF.

Josh
  • 1,794
  • 3
  • 17
  • 31