Bug 971648 - Min Values in Graph Legend on right shows 0 when sometimes not true
Min Values in Graph Legend on right shows 0 when sometimes not true
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
4.7
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: RHQ 4.8
Assigned To: Mike Thompson
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-07 00:46 EDT by Mike Thompson
Modified: 2013-09-11 05:52 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-11 05:52:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Min value error (87.66 KB, image/png)
2013-06-07 00:49 EDT, Mike Thompson
no flags Details
Screen capture showing corrected results. (553.24 KB, image/jpeg)
2013-06-07 12:41 EDT, Mike Thompson
no flags Details

  None (edit)
Description Mike Thompson 2013-06-07 00:46:16 EDT
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 00:49:06 EDT
Created attachment 757982 [details]
Min value error
Comment 2 Mike Thompson 2013-06-07 12:38:26 EDT
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 12:41:07 EDT
Created attachment 758244 [details]
Screen capture showing corrected results.
Comment 4 Mike Thompson 2013-06-07 16:10:19 EDT
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 05:52:47 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.