Change usage stats to not use google charts

Gerhard Killesreiter - April 9, 2009 - 07:33
Project:Project
Version:6.x-1.x-dev
Component:Usage statistics
Category:feature request
Priority:minor
Assigned:Unassigned
Status:active
Description

The general policy for drupal.org is to not use black boxes, so I would like to have the graphing solution to be replaced with something that is Open Source. I'll do some research on possible solutions.

#1

Gerhard Killesreiter - April 9, 2009 - 14:53

CiviCRM is going to switch to use

http://pchart.sourceforge.net/

(see: http://issues.civicrm.org/jira/browse/CRM-3361)

We should look into using it. I am envisioning that we run a cronjob that pregenerates all PNGs as a standalone script.

#2

aclight - April 9, 2009 - 15:11

I understand the principle behind open source and not using black boxes, but in this situation I don't know that we gain much by not using Google charts, at least as long as that service is available and reliable.

One downside to creating these graphs as .png files is that the bandwidth usage might increase substantially. I have no idea how many hits the project usage pages get, but I just looked at the chart at http://drupal.org/project/usage/drupal (created by Google) and the size of the .png is about 20k. If these files are recreated each week (which will be a *lot* of png files, btw), caching on the local user's computer is probably not going to reduce the need to download the images.

Also, having a separate script and additional dependencies makes it more difficult to test this part of the code and for other sites that want to run the project_usage module (granted, probably very few) to do so.

#3

Gerhard Killesreiter - April 15, 2009 - 18:10

What we gain is independence from google.

#4

dww - April 15, 2009 - 21:29
Priority:normal» minor

We've already got all the google charts code working, so I'd prefer not to flush that code in cases where folks just want to use that. So, if/when someone works on this (/me points to the "Unassigned" value in the "Assigned" field), I'd like to see the code for generating the charts moved into .inc files and just move the existing google chart code into a project_usage_chart.google.inc (or something) and then add whatever non-google alternative to a project_usage_chart.foo.inc. That way, folks that what to use the existing solution can, and d.o can run something else.

Also, given how many other things need work, including critical bugs, and far more urgent features (e.g. for the d.o redesign launch) I'm dropping the priority on this to minor. @killes: if this is really important to you, write the code or find someone else to do so. However, if you're finding project* help, I've certainly got a lot more important things they could be working on. ;)

That said, I'm happy to find a different solution for all the new project* charts and sparklines as part of the redesign. We don't have to keep using google for those, just because we're using google for this (for now).

#5

JohnForsythe - May 3, 2009 - 14:34

I would recommend taking a look at Flot. It's a jQuery plugin that creates graphs with CSS. No mass-generation of PNG files required.

http://people.iola.dk/olau/flot/examples/graph-types.html
http://code.google.com/p/flot/

#6

Gerhard Killesreiter - May 3, 2009 - 15:04

I've looked at FLOT. It looks very interesting, however I was not able to save the generated graphics as files. I think that this is an important feature.

#7

JohnForsythe - May 3, 2009 - 15:24

I'm not so sure that's a big loss. Screenshots are easy to take. Mollom uses flash to generate its graphs, and you can't save that either, but it doesn't stop anyone from reusing the data:

http://images.google.com/images?q=mollom%20graph

#8

drewish - May 7, 2009 - 21:07

speaking as the person who wrote the original code, i think swapping this out it a totally waste of time. we've got working code that's using a free, reliable web-service that doesn't put a cpu or bandwidth load on d.o. should try to gain independence from the OSL next?

#9

drewish - May 7, 2009 - 21:16

pcharts doesn't seem to have any sparkline support either. http://sparkline.org/ seems like it might be a better php solution for those graphs.

#10

rashad612 - October 21, 2009 - 09:26

I think pChart is a promising solution. It's open source, free, and the class files hosted in your server.

 
 

Drupal is a registered trademark of Dries Buytaert.