Bug 971648

Summary: Min Values in Graph Legend on right shows 0 when sometimes not true
Product: [Other] RHQ Project Reporter: Mike Thompson <mithomps>
Component: Core UIAssignee: Mike Thompson <mithomps>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.7CC: hrupp
Target Milestone: ---   
Target Release: RHQ 4.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-11 09:52:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Min value error
none
Screen capture showing corrected results. none

Description Mike Thompson 2013-06-07 04:46:16 UTC
Description of problem:
The min appears to be zero sometimes when it looks like it should not be. Possibly counting NaN values as zero?

The code should avoid this as it handles undefined values:

 min = $wnd.d3.min(chartContext.data.map(function (d) {
                        if (d.low != undefined) {
                            return d.low;
                        }
                        else {
                            return Number.MAX_VALUE;
                        }
                    }));

Maybe missing a case.

Comment 1 Mike Thompson 2013-06-07 04:49:06 UTC
Created attachment 757982 [details]
Min value error

Comment 2 Mike Thompson 2013-06-07 16:38:26 UTC
This was actually affecting min, max and avg values as the NaN's were not properly being filtered first before the applying the mean calculation. I have added the filter operation first now and values appear correct see attachment.

commit to master: a0c9230

Comment 3 Mike Thompson 2013-06-07 16:41:07 UTC
Created attachment 758244 [details]
Screen capture showing corrected results.

Comment 4 Mike Thompson 2013-06-07 20:10:19 UTC
Also committed additional bug fix to 
master: 9ad39f0
for a regression that I introduced with this fix via commit a0c9230.

Comment 5 Heiko W. Rupp 2013-09-11 09:52:47 UTC
Bulk closing of old issues now that HRQ 4.9 is in front of the door.

If you think the issue has not been solved, then please open a new bug and mention this one in the description.