Total in graph report is incorrect

RESOLVED FIXED in Bugzilla 2.18

Status

()

Bugzilla
Reporting/Charting
RESOLVED FIXED
15 years ago
5 years ago

People

(Reporter: juanhernandez, Assigned: Jon)

Tracking

unspecified
Bugzilla 2.18
Bug Flags:
approval +

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)
Build Identifier: 

The Total count of bugs in the Graph report is calculated incorrectly. I 
created a report where:    -- 
Note: total(297) given correctly in tabular report and in query mode.

Reproducible: Always

Steps to Reproduce:
1. set the horizontal axis=product;
2. vertical axis=status;
3. Multiple Image=Component;
4. The Product=Bugzilla;
5. Components=Creating/changing bugs and Installation & upgrading;
6. Status=New;

Actual Results:  
The counts were: 
Creating/changing bugs=256; Intalling & upgrading=41; 
Total given as 104

Expected Results:  
Total should have been 297
(Reporter)

Comment 1

15 years ago
problem is in bar chart
Yep, that's definitely wrong :-) I'll try and reproduce it on my local install.

Gerv
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
(Assignee)

Comment 3

15 years ago
Created attachment 125766 [details] [diff] [review]
Proposed fix

The problem seems to be in bar, line and pie reports.  It looks like the totals
chart in each case can be wrong for a couple of different reasons.  When it is
building the image_data in report.cgi, the array with the total values is the
last element in image_data but graph.plot is called with the first array
element.  The patch changes the push to an unshift in report.cgi so that totals
would be first.

Secondly, the field being used to generate the multiple tables(tbl_field) is
being selected on all possible values of its type even if the report query only
asked for a selected set of values.  The patch to report.html.tmpl adds a loop
through the tbl_names to rebuild this part of the query when plotting the
totals chart.

For the testing I have tried this seems to work, but no doubt I missed
something.
Thanks for the fix :-) I'm snowed under right now, but I'll look at it as soon
as I can.

Gerv
Comment on attachment 125766 [details] [diff] [review]
Proposed fix

Great stuff - thanks very much for the fix. r=gerv.

Gerv
Attachment #125766 - Flags: review+
Flags: approval?
-> patch author
Assignee: gerv → kniht
Status: ASSIGNED → NEW
Flags: approval? → approval+
OS: Windows 2000 → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 2.18
Fixed. Many thanks :-)

Checking in report.cgi;
/cvsroot/mozilla/webtools/bugzilla/report.cgi,v  <--  report.cgi
new revision: 1.18; previous revision: 1.17
done
Checking in template/en/default/reports/report.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/reports/report.html.tmpl,v
 <--  report.html.tmpl
new revision: 1.6; previous revision: 1.5
done

Gerv
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.