Server Side Chart & Graph generation? pChart looks nice.

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
R.J. Steinert's picture

Only local images are allowed.I've just finished setting up the first Beta 1 installation of Sensor Hub and it required me to port a couple months of data from an old alpha installation to the new installation. 26,000 data points that is... While I can use certain Views filters to limit the results for plotting with the Flot Charts module, I would really love to be able to see all of this data in one chart. It's just data from a couple of months afterall. So I could use some various server side algorithms to reduce the amount of points output thus making it a managable for download and rendering on the client side, but I'm starting to get the feeling that the mentioned technique might just end up being a game of spin the bottle *ahem* I mean a game of moving the bottleneck around.

A quick search on open source server side graphing libraries brought up pChart http://www.pchart.net/. Looks pretty spiffy. Anyone have any experience with it?
Only local images are allowed.

Comments

GPL issues?

mwl's picture

this looks real cool but their split non-commercial GPL and commercial pay licensing split seems to be a violation of the GPL.

GPL point 10:
"For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it."

pChart:
"If your application can't meet the GPL license or is a commercial one (eg: the library is integrated in a software or an appliance you're selling) then you'll have to buy a commercial license. With this license you don't need to make publicly available your application code under the GPL license terms."

pChart

lbeck37's picture

I've been using pChart as way of showing MySQL data on web pages and it has worked OK for me, although the license stuff has me confused. I was surprised to find that there was not much to choose from when it came to open source graphing programs so I used pChart to allow me to get away from .NET for web pages and display some simple (or what I consider simple) line graphs with a time X-axis and the Y-axis representing things like temperature. I wrote some PHP to pull the data from a MySQL database and to call the pChart library to make the plots. It was my first foray into PHP and I didn't have too much trouble getting the code to work, although I had some trouble understanding how pChart was passing the chart parameters to the graphing library. I got it figured out and corrected some bugs in the pChart PHP library (having the source was of course important). The pChart library (I was using the original version since I didn't learn until later that it's been replaced by a new version) is not well tested as the XY graphs I use (the other graph types expect the data for the multiple lines to share the same set of X values) didn't show the axis labeling correctly until I found the bug which was an obvious copy-and-paste from another type of graph that didn't get changed.
It sounds from the GPL issue that I will have to figure another way to make my plots when I go into production. I would be interested in finding out where there might be a graphing package that will make the plots I want (single graphs with separate lines for data from multiple sources with unique time and Y values for each). I looked at the Google Chart stuff but it didn't seem to allow me to put lines of data on a single graph if the data points didn't share the same time values. Google Charts is like some other packages and expects the data from the sources to be like a spreadsheet where the Y values are from different columns but the time values are from a single column shared by all the Y values.
I looked a little into Protovis which looks pretty neat but it needs HTML5 (for Canvas?) and I need my graphs to be seen by all sorts for browsers including IE and mobile devices. I also wonder if Flot will work for me but I want to get my Drupal site up and working before I look into it. I'm a newbie in Drupal and really like it but I'm struggling to understand how to best incorporate my MySQL/pChart PHP program. I'm thinking I need a custom Drupal Module and I'm relying on the book "Drupal 7 Module Development" by Matt Butcher, et al. to help me figure that out. This book seems pretty good on this topic.
If I find a way to do my charts open source w/o pChart, I'll post something here. Sorry about thislong winded post, I hope that's OK on this forum.
--Larry

Just released a developer

ckng's picture

Just released a developer module for pChart, check it out http://drupal.org/project/pchart

CK Ng | myFineJob.com

Charts

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: