GNOME Bugzilla – Bug 330719
piecharts drops negative data too - error message misleading
Last modified: 2018-06-29 20:57:17 UTC
Piechart reports filter out accounts with nonpositive values, since their visualization would be confusion and kind of unnecessary. Reproduction: Create a new expense account and transfer a positive amount to some other account. Open an Expense Piechart report. "The selected accounts contain no data/transactions (or only zeroes) for the selected time period" Expected Behavior: Data can be zero or negative (not only zero). (Maybe wrong report currency) Source of the problem: account-piecharts.scm if null? combined -> calls gnc:html-make-empty-data-warning maybe this warning should be split up to represent the two possible filters (=0 and <=0) for bar- and piecharts.
=0 piechart data points are still valid, I believe: they get printed in the legend, but have no segment in the graph report. =0 bar-chart segments are valid: they are in the legend but with no segment in the graph. <0 bar-chart segments are valid (with gog, anyways). <0 pie-chart segments should probably display a warning near the graph in the report if there is one in a piechart of other valid segments ("This pie chart does not contain some negative values"). As well, the empty-data warning should appear if all the piechart segments are <=0. This is what happens now. I don't know if it's right to make the values positive, Obviously the piechart can't display negative wedges, but taking the absolute value doesn't strike me as necessarily correct. Maybe it should be an option --- "display negative values". Then you could at least get the relative size of the positive and negative expense amounts. Perhaps even with a different plot fill-pattern for the negative values to visually differentiate them. I guess the simple fix is to make the error message read something like: "The selected accounts contain no data/transactions (or only zeroes (or only negative values)) for the selected time period."
I just ran into this today. Ideally the heading (with total) would include the negative values, as would the legend, but negative values would be dropped from the pie itself... Otherwise the total in the heading starts to depend on the depth selected (which affects which things are grouped), which is pretty odd.
Oh, and this can pop up for perfectly norrmal reasons, nothing to do with currency. For example, the "United States Federal Income Tax" expense account can easily be negative for someone with a small income who gets FDIC credits that make their year-end tax liability negative.
GnuCash bug tracking has moved to a new Bugzilla host. The new URL for this bug is https://bugs.gnucash.org/show_bug.cgi?id=330719. Please continue processing the bug there and please update any external references or bookmarks.