Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Relative axis scaling in graph doesn't work with negative values

#257

From #122 Improve graph readability

the Net Worth graph doesn't always adjust the vertical axis properly. If the entire graph is positive, then the zero line is shifted down (off the graph) to let you see the "detail" in small variations (e.g. if the net worth ranges from 34,100 to 35,600 the vertical axis will run from 34,000 to 36,000).
But it doesn't do this when the entire graph is negative (e.g. if the net worth ranges from -34,100 to -35,600 the vertical axis runs from 0 to -36,000), so with a loan/mortgage where monthly changes are maybe 1% of the debt, its very hard to see what the graph is doing.

Reported by Virgil Dupras · May 14th, 2011 @ 10:35 PM

State: fixed
Milestone: none
Assigned to: Virgil Dupras Virgil Dupras

Activity

  1. frog
    frog

    If you've not already done the fix, it's presumably just a matter of removing the outer max() from line 66 of core/gui/balance_graph.py:

            ymax = max(0, max(point[1] for point in self._data))
    

    becomes

            ymax = max(point[1] for point in self._data)
    

    I've not had time to get all the dependencies together to get it building yet, so can't yet test to see if it makes sense or breaks any tests...

    June 2nd, 2011 @ 10:54 AM

  2. Virgil Dupras
    Virgil Dupras

    Yeah, it's probably a very simple fix. But what I have to do (which I haven't done yet) is to check whether there was a reason for this axis behavior.

    June 2nd, 2011 @ 04:09 PM

  3. Virgil Dupras
    Virgil Dupras

    (if there's a reason, there's a test for it, so yeah, it's a matter of making the fix and see if it breaks any test)

    June 2nd, 2011 @ 04:10 PM

  4. Virgil Dupras
    Virgil Dupras
    • State changed from new to accepted

    I could reproduce the bug. In a new file, put a "negative" transaction for 10k and the scale of the NW graph will go from 0 to -20000. Make it "positive" and the scale goes from 9900 to 10100.

    June 4th, 2011 @ 03:37 PM

  5. Virgil Dupras
    Virgil Dupras
    • Assigned user set to Virgil Dupras

    June 6th, 2011 @ 08:13 PM

  6. Virgil Dupras
    Virgil Dupras
    • State changed from accepted to fixed

    June 6th, 2011 @ 08:47 PM

  7. Virgil Dupras
    Virgil Dupras

    @frog: It didn't break any test, and yes, it was this line.

    June 6th, 2011 @ 08:48 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.