-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pie chart #1467
base: master
Are you sure you want to change the base?
Pie chart #1467
Conversation
Thanks for reviving this!
|
Also, screenshots welcome when you get to that point! |
Nifty. Is it in addition to/instead of the line chart ? examples/bcexample.hledger is a pretty good example journal. |
showing 2 pie charts when there are both positive and negative transactions might still be a good improvement, but I think this PR is ready to be reviewed even without that. |
(Thought I replied to this earlier, but I don't see it.) @raboof, won't it potentially show misleading results without that capability ? I think we need it. |
Updated to split the pie chart into positive and negative accounts (only showing them if there is more than one account to show). The chart would still be confusing when accounts use multiple currencies. I don't think splitting those into multiple pie charts as well would make too much sense - I'm just hiding the pie charts in that case for now. |
That sounds good. Will review as soon as I clear some PR backlog, thank you! Other reviewers welcome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raboof: I've got this running locally. Great work so far. I'd like to improve usability a bit more if you have time. Do you think some of these could be done:
- Always show both charts, in the same stable positions. When one can't be shown for whatever reason, show it greyed out, or at least some placeholder.
- Show the charts side by side, to use less vertical space. Negative amounts always on the left, positives on the right I guess.
- In the legend, show the amounts. I know you'll be short of space, maybe the percentage is not necessary there ?
hledger-web/hledger-web.cabal
Outdated
@@ -103,6 +103,7 @@ extra-source-files: | |||
templates/edit-form.hamlet | |||
templates/journal.hamlet | |||
templates/manage.hamlet | |||
templates/piechart.hamlet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind making this same change in the package.yaml file, from which this is generated. (Changing the .cabal file as well is optional, stack does it automatically and I sometimes commit that change separately/later to reduce conflicts.)
Also, I have seen it show two pies for one particular account, but most of the time it shows only one, or none. Perhaps there's a bug ? Eg with examples/sample.journal, a single pie is shown for expenses and for income, and no pies for any other account. |
Funny, I introduced hiding charts when there is no meaningful data a usability feature, not a shortcoming :D. Happy to adapt though.
It shows a pie chart when there is more than one (sub)account being reported on, unless those (sub)accounts contain multiple commodities. That was intentional, but if it creates more confusion than it reduces noise then we should indeed implement a more straightforward behaviour ;). |
I limited my testing to a single commodity, I'm pretty sure. See if you can reproduce the issue with examples/sample.journal. As a user I'm confused when the pies come and go, especially when I can't see the reason.
|
This matches what I would expect:
So this was indeed my intended behavior - but evidently that wasn't very intuitive. I'll look into always showing both charts. |
My idea might not be right either. I just found it confusing as is.
|
Hi @raboof, I just tested your latest push. The solid pie charts are a bit clunky of course, but for now, they do reassure that the feature is working.. Any idea why no charts are shown for the sample journal's assets:bank:checking ? http://127.0.0.1:5000/register?q=inacct%3Aassets%3Abank%3Achecking%20 Wouldn't it be more familiar to have the chart for positives on the right, and negatives on the left ? I wonder how it feels if you show amounts instead of percentages ? Do you think it's feasible to have some useful info (eg amount) always showing on or near the pie slices themselves ? |
I hate to be “that person”, especially when so much great work has been put in here, but I feel compelled to raise the point that it's notoriously difficult for people to be able to extract accurate information from pie charts. When I generate my financial charts, I use a stacked bar chart with absolute amounts on the left y-axis and percentage of total on the right y-axis for this purpose. It's easier to read, easier to display, and allows you to include both positive and negative amounts in a sensible way. |
(will check when I get back to this)
Sounds reasonable, will update.
I think that would be a great idea (though there's something to be said about percentages as well, as they are less likely to invoke 'fear of big numbers' :D ). Perhaps not absolutely necessary for this first iteration though - haven't looked into how hard it would be yet.
Don't worry ;)
To be honest I feel like many of those points don't apply so strongly here. Obviously the '3d' pie charts are pure evil. We don't really seem to suffer from any of the '4 signs that your pie is failing', mainly because it's interactive rather than a static image. The 'small percentages' aren't particularly important in our case.
I would love to have those, and they might indeed replace pie charts. Until we have those, though, I think at least having the pie charts would be a significant improvement over not having them :). |
Good discussion. @raboof stop me if the below seems not the latest code, I think it is though. I'm testing with
Sorry this is hard to get merged. The UI polish is a big part of the task, and in the present state I'm not sure it adds enough value to release it. |
Yeah it is - I should've converted the PR to 'draft' though since I didn't yet find time to pick up some of the comments that I do plan to.
No worries - I only find time to work on this occasionally so that rather drags things out wall-clock-wise, but so far I'm happy with the process. |
My use case is definitely 'subaccounts': I import and auto-classify my banking statements, and then use hledger-web to get a feel for 'where my money is going' (and later I'd like to add budgeting). The pies are nice for that while browsing the 'expenses' tree, like 'x % of my expenses in this period where utilities', with the option to from there 'zoom in' to the individual accounts under 'utilities', etc. Showing charts of the 'accounts being transacted with' would also kinda work: I could open |
Yes please. 👍🏻 I guess just drag into the GitHub issue when commenting, probably dragging into an email reply also works. If we're chatting, dragging into Element works similarly.
|
the paste site shortcut in topic - I think it's https://pasteimg.hledger.org
(No longer in the topic, it's http not https, and now has ads - dropping this.)
|
Sure!
Can't hurt ;) (https://hledger.org/charts.html?)
I'm personally mainly interested in 'interactively' browsing the data (selecting date ranges and subaccounts). Some graphs might not really be that useful when you have to switch between several tools to see them, but could be useful when integrated into hledger-web - so if we wait for them to "seem to have wide usefullness" outside of hledger-web they might never.
I agree a standard example might be helpful. A complication in this particular dataset is that it includes expenses in different currencies (USD and IRAUSD), making them trickier to graph of course - which might be an advantage or a disadvantage depending how you look at it. Do you have ideas on how to handle multiple currencies in one graph?
This is not bcexample.hledger, right? It's not clear to me why "Food" is split into ''Irregular expenses" and "Regular expenses", how does that work? |
I classify groceries as regular expenses and restaurants and irregular expenses. I grant that this breakdown is specific to me, and it's probably not desirable to apply this widely. |
56bc295
to
01f9c70
Compare
What should we do with this PR ? |
It's up to you: I still like the feature and am happily using this branch of hledger. Of course I'd hoped it'd be of use to more people than just myself, but I respect that you don't consider it acceptable for inclusion in this state. I don't really see how to make it more attractive, though :). I'm OK with either closing the PR or keeping it open for future suggestions. |
Co-Authored-By: Tom Sydney Kerckhove <[email protected]>
Co-Authored-By: Tom Sydney Kerckhove <[email protected]>
didn't add a label since that would probably just be confusing, which is which is likely pretty clear from context.
Since the result would be hard to understand anyway
No charts is shown when there is no data or the data is in multiple commodities. Perhaps in that case we should show some error and/or a 'greyed-out' chart?
See issue #538
Took https://github.com/NorfairKing/hledger/commits/pie-chart as a starting point