4. Constraints
• Looks the Same on Screen and in Print
• Pure PHP or JavaScript/Flash with PHP
• Aesthetically Appealing
• Works in IE7+8
• Interactive
• Not Complicated
• Local (No Internet Required)
25. Back to the Problem
Get a chart that looks
the same on the web
and in a PDF.
26. Constraints
• Looks the Same on Screen and in Print
• Pure PHP or JavaScript/Flash with PHP
• Aesthetically Appealing
• Works in IE7+8
• Interactive
• Not Complicated
• Local (No Internet Required)
The issue with all of these was resolution - they all generate 72 DPI images that don’t print well. In addition they didn’t have interactivity and the look of the charts themselves was generally a step below.\n\n\n\n\n
Flexible but a little complex.\n\nTried some “make it too large then scale it down” options, but that didn’t work well - fonts too small, spacing issues, etc. \n\nCan be ugly or can be nice depending on how much time you’re willing to put in.\n\nSSL issues\n\nGoogle could turn it off - see Google Translate\n
PHP-based solution\n\nkind of ugly\n
Just came out with a version 2.\n\nQuite good.\n\nLots of nice computation functions.\n
The issues here are first, they’re Flash, and I don’t want to work with Flash (doesn’t work on iPad, etc.). Most of these can generate images as well but sometimes they do it client side instead of server side which is not useful. Plus the resolution of the generated images was 72 DPI in all the ones I tried.\n\n\n\n\n\n
Flash-based which I was trying to avoid. \n\nIn researching this I found that it could be a good solution with how it works now. When I was looking at it my understanding was that to get the other formats, you first had to load the Flash graph and then it would be able to generate the SVG. I think now you can have it choose server side what to do. \n\nCould be another good option.\n
Maani.us Flash/XML charts\n\nFlash-based, export to image\n\nimage is 72 DPI, and is a client side prompt (this was true of a lot of Flash charts I looked at - the Flash had to be loaded on screen and then it would download)\n\n
v3 is implementing a SVG-based JavaScript solution - based on HighCharts!\n
Implementing a SVG-based JavaScript solution as well\n\nCan export as image or PDF, but requires server-side script to handle the passed image data. I would bet resolution is 72 DPI.\n
JavaScript-based solution in beta\n\nVideo on their website of it running on an iPad\n\n\n
Google Charts - not local, 72 DPI, no option for different resolution. Flexible but a little complex. Tried some “make it too large then scale it down” options, but that didn’t work well - fonts too small, spacing issues, etc.\nSwiff Chart Generator - Flash-based which I was trying to avoid. In researching this I found that it could be a good solution with how it works now. When I was looking at it my understanding was that to get the other formats, you first had to load the Flash graph and then it would be able to generate the SVG. I think now you can have it choose server side what to do. Could be another good option.\nMaani Charts - Flash-based, export to image - image is 72 DPI, and is a client side prompt (this was true of a lot of Flash charts I looked at - the Flash had to be loaded on screen and then it would download)\nRaphael/gRaphael - In development so a little early. When I was looking it was quite early. But a good option.\njQuery SVG - has charting extensions, kind of ugly\nsvgweb - semi-Google project. In beta, not targeted at charting\njqPlot - uses canvas.\n\n\n\n
Requires jQuery\n\nRequires excanvas\n\nWe tried this, and even looked at doing canvas to SVG conversions\n
\n\n\n\n
Really beautiful\n\nDoes not require jQuery\n\nIn development - missing a lot of functionality\n\nFree\n
Free for non-commercial\n\nMature\n\nRequires jQuery\n\nHelps with time-based axes\n\nWorking on stock charts\n\nReally great support forums\n
More of a build-your-own\n\nFree\n\njQuery Required\n\nNot graph-focused\n
\n
\n
Came out with SVG-beta right when we needed this\n
\n
\n
\n
\n
\n
Some other PDF libraries (like HTML2PDF) are based on TCPDF\n
\n
Zend PDF doesn’t support SVG\nwkhtmltopdf has PHP bindings but they are complex to implement\n\n