Closed (outdated)
Project:
Graphstat
Version:
6.x-1.x-dev
Component:
Code / API
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2008 at 23:30 UTC
Updated:
21 Apr 2016 at 18:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
thekevinday commentedThere is a problem with phpplot, perhaps I will send the fix upstream.
I also have an updated version of php plot and the fix for that, so the php plot update patch and it's fix is also provided.
You could also manually update phpplot by going here: http://sourceforge.net/projects/phplot/
and then copying the phpplot.php file over into this module
Comment #2
lbayuk commentedHello, I'm the "upstream" for PHPlot. I'm having trouble seeing how this error is possible. It implies you tried to make a pie chart with no data at all, but there is a check for that case and it should have been caught earlier.
I will look into it some more to see if I can figure out how it happens. But any additional information you can provide will be helpful. (FYI, I do not yet know anything about drupal.)
Comment #3
thekevinday commentedThis happened to me on a clean install when the server does not yet have any logs to report on the graph.
The graphs end up as either a blank screen or as the warning message stating that no data is available.
So yes, there is an attempt to make an empty graph at some point.
Edit: I am using php 5.3.
Comment #4
lbayuk commentedOK, I can duplicate the error by using a malformed data array. That is, PHPlot detects correctly if the data array is missing or empty. But if there is a data array, and it has some records, but the records have no data points at all, then it gets by the first checks and then fails in more ugly ways later.
I can fix this (probably not with your patch, though, which only deals with one case in pie charts), and make it fail more gracefully. However, this won't fix the underlying problem with this graphstat module. It really needs to detect that there is no data before it tries to make a graph. It seems to me that it already tries to do this.
In graphstat.module function graphstat_render_graph():
But for some reason that check isn't working (same as PHPlot isn't catching the array with records but no actual data). The answer may be somewhere in graphstat_statistics.inc but I'm lost here.
Unfortunately, I see the graphstat module is listed as "abandoned" so I guess there isn't anyone to look into it.
Comment #5
lbayuk commentedHello to the new module maintainer. I released PHPlot-5.1.0 on 2009-12-24, and it includes a fix for this issue. Specifically, if a pie chart data array contains no positive Y values, you will get an image without a pie.
As I said above, there may be a better fix inside the graphstat module, which seems not to be detecting when there is no data in this case. But using the updated PHPlot will at least prevent it from tossing a PHP error.
If I can be of any help, feel free to contact me. Same name I use here, @users.sourceforge.net
Comment #6
thekevinday commentedHere is the patch to update phpplot to version 5.1.1.
Comment #7
kenorb commentedClosed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.