Fix maximum y-value-range computation

Authored by alexde on Sep 17 2019, 4:51 PM.

Description

Fix maximum y-value-range computation

Summary:
Rounding to the next 10 did not work if the maximum value was something like y_max = 30.947
In this case modulo 10 gives 0 and therefore the maximum values becomes 30 in the end, though it should be 40
otherwise the peak points outside of the chart.

Floor(max) + 10 always works.

Test Plan:
Before:


After:

Reviewers: VDG, Plasma, ngraham

Reviewed By: VDG, ngraham

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D24029

Details

Committed
ngrahamSep 17 2019, 4:53 PM
Reviewer
VDG
Differential Revision
D24029: Fix maximum y-value-range computation
Parents
R102:09942b682407: SVN_SILENT made messages (.desktop file) - always resolve ours
Branches
Unknown
Tags
Unknown

I have spotted a mistake, it should have been something like this with floor:

294                     if (root.historyType == HistoryModel.RateType) {
295                         var max = Math.floor(history.largestValue)
296 
297                         return max - max % 10 + 10 // ceil to the next 10
298                   } else {

I cannot submit again due a arc error

Usage Exception: No changes found. (Did you specify the wrong commit range?)

I cannot fix now as I am in a hurry until the weekend. Maybe you can correct it for me?

Regards