hledger-web: how to show running total on filtered chart

306 views
Skip to first unread message

shaun smiley

unread,
Aug 18, 2024, 4:33:53 PM8/18/24
to hledger
I'm just diving into hledger.  I have converted several years worth from kmymoney successfully. 

In hledger-web it shows a nice chart to the top right.  The values looks good until I select a subset to zoom in (i.e. filter).  Then the running total starts at the start of the filtered dates, which means it's no longer a running total. 

How can I get this to show a true running total?  

I have used --historical in hledger for a few balance reports, but hledger-web doesn't accept --historical. 

Simon Michael

unread,
Aug 18, 2024, 4:42:49 PM8/18/24
to hle...@googlegroups.com
Welcome Shaun. Sorry you hit it, but that seems a fairly blatant hledger-web bug! The register and chart should probably always be in historical mode, like hledger-ui's.
--
You received this message because you are subscribed to the Google Groups "hledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hledger+u...@googlegroups.com.

shaun

unread,
Aug 20, 2024, 11:28:51 AM8/20/24
to hle...@googlegroups.com
Thanks for confirming.  This may be a reason to up my haskell game and figure out the code base!

--
Shaun


You received this message because you are subscribed to a topic in the Google Groups "hledger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hledger/jSAYYL6ujGQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hledger+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hledger/22c36618-f93e-4e56-9a52-601245407581%40app.fastmail.com.

Simon Michael

unread,
Aug 20, 2024, 1:23:10 PM8/20/24
to hle...@googlegroups.com
Sounds good! Happy to support in the hledger chat.

shaun

unread,
Aug 21, 2026, 7:43:24 PMAug 21
to hle...@googlegroups.com
I finally got around to doing this, although I'm still a baby haskeller.  
I did use A.I. (Gemini 3.6 flash) to work out the solution.  
I tested it locally by building the hledger-web and confirmed that it implemented the equivalent of adding --historical. 

I went to open a PR and read the policy #4: 
> 4. First-time hledger contributors must not use AI to generate PRs.
>    New-contributor PRs that seem AI-generated will be closed.

So I stopped and did not submit the PR.  

The fix was very small, 1 change and 2 additions: 


--
Shaun


Simon Michael

unread,
Aug 22, 2026, 3:10:41 AMAug 22
to hle...@googlegroups.com
Thanks for respecting the policy Shaun.  If you'd like, do some other small PR manually, then you could submit this one and get the credit. Otherwise, I'll apply the fix in a while. Thanks!

shaun

unread,
Aug 22, 2026, 1:29:11 PMAug 22
to hle...@googlegroups.com
I tested it a bit more and realized that my first patch applies historical in all contexts, which is actually not always desirable.  I am working on a way to toggle it on or off.  I have that working by manually appending `&hist=1` to the URL, but not with any sort of UI option yet.  Once I have it working I'll push to my fork.  

> If you'd like, do some other small PR manually
Sure, I'll take a look around on the Github issues for something else I could contribute to and fix it up, then come back to opening a PR afterwards. 


--
Shaun


Reply all
Reply to author
Forward
0 new messages