GNOME Bugzilla – Bug 737815
Graphs cannot be generated correctly
Last modified: 2018-06-29 23:34:32 UTC
Typical graphs generated in 2.6.3 are not generated correctly in 2.6.4. The stacked columns of the graphs are all bunched up together. Changing options does not help. Problem easily reproducable.
I can reproduce it also with Ubuntu 14.04 after the latest update to Gnucash 2.6.4.
Same problem with 2.6.4 on my system (Debian Testing).
Created attachment 288230 [details] problem with bar chart
Comment on attachment 288230 [details] problem with bar chart My observations on - For Assets and Liabilities, all bar charts just produce a blank page. - For the income and expense bar charts, the stacked ones have gaps as shown in the attachment to my previous post, and in the non-stacked ones, the bars are too wide and obscure other bars. See attached Income/Expense chart for an example.
Created attachment 288232 [details] stacked bar chart
I find only one commit between 2.6.3 and 2.6.4 that affects bar chart rendering: https://github.com/Gnucash/gnucash/commit/88bfbb19a043949ca406d52036578ece27611ca4 This was a fix for bug 720934. It may be the cause of this regression but I haven't had time to dig deeper.
Comment on attachment 288232 [details] stacked bar chart The "gaps" are actually the green and orange bars that are shifted on place to the right. Or the blue bar one position to the left, depending on how you want to see it. There seems to be a date mapping issue in here.
Created attachment 288288 [details] [review] change loop condition in html-barchart.scm This patch should fix the issue with the gap and the mapping. It works on my end - please let me know if it also works on yours.
Getting closer. That patch fixes the problem with 'jumbled' (horizontally offset) bar charts, but I still see the following problems at a glance: 1. No asset bar charts work - they still paint a blank canvas 2. Dates on bar charts are incorrect. For example, if I use the Expense bar chart for this year, in one month periods, I expect 12 bars labeled for each month, instead they are labeled 1-Jan-14 ... 12-Jan-14.
Created attachment 288351 [details] Screen showing Assets report. I'm not seeing either problem in Win7, as can be seen from the attached. (I haven't applied Carsten's patch, so the bars are still offset.)
Here with Ubuntu 14.04 the patch looks also fixes some aspects of the horizontal offsets (not completely see below). Thank you so far! I also have some more problems with bar charts at all: - The width of the bars is far too wide in the asset bar charts. It seems always to be fixed to 119(?) pixels or so, independent of the amount of bars visible or the width of the diagram (or interval chosen). So in case of a lot of bars, they all are overlapping and the result is really useless at the moment. - In the Income/Expense bar charts the width of the bars seems also not to be calculated correctly: with 4 months I have a width of 26 pixels for each bar, but with 22 months displayed I have a width of 38 pixels. - In the Income/Expense bar charts the current/last month is on the very right side of the diagram, so mostly I can not see the rightest of the 3 bars for a month.
(In reply to comment #10) > Created an attachment (id=288351) [details] > Screen showing Assets report. > > I'm not seeing either problem in Win7, as can be seen from the attached. (I > haven't applied Carsten's patch, so the bars are still offset.) There are problems with both stacked and unstacked versions of the bar charts. Your screenshot shows two of them in the stacked type bar charts: 1. All series but the first one are offset by one month. This is gets fixed with Carsten's patch. 2. The first and last bar are rendered partly outside of the charting area instead of fully. For the first bar, the left half is cut off, for the last bar the right half is cut off. This second issue is a side effect of changing axis renderer from categoryAxis to dateAxis type. The dateAxisRenderer renders the bar at the tick. In the screenshot this can be seen on the bars the are rendered right on a grid line (and the tick is at the extension of the grid line). The categoryAxisRenderer we used before renders the bars *between* the ticks and similarly puts the date labels (treated as "categories") in between the ticks as well.
(In reply to comment #11) > Here with Ubuntu 14.04 the patch looks also fixes some aspects of the > horizontal offsets (not completely see below). Thank you so far! > > I also have some more problems with bar charts at all: > > - The width of the bars is far too wide in the asset bar charts. It seems > always to be fixed to 119(?) pixels or so, independent of the amount of bars > visible or the width of the diagram (or interval chosen). So in case of a lot > of bars, they all are overlapping and the result is really useless at the > moment. > - In the Income/Expense bar charts the width of the bars seems also not to be > calculated correctly: with 4 months I have a width of 26 pixels for each bar, > but with 22 months displayed I have a width of 38 pixels. > - In the Income/Expense bar charts the current/last month is on the very right > side of the diagram, so mostly I can not see the rightest of the 3 bars for a > month. I can see this as well on Fedora. This again is a side effect of using the dateAxisRenderer for the horizontal axis. Replacing it with a categoryAxisRenderer again fixes the problem at once. It looks like the dateAxisRenderer was not meant to be used with a barchart. Later today I will apply Carsten's patch and revert the axis type back to category. That will at least solve the bar position/size issues we have so far. On the other hand that means bug 720934 will have to be reopened, because we loose the option to skip labels from the x-axis if there are too many. I believe though that issue is less serious than the visual inconsistencies we have created now.
(In reply to comment #4) > (From update of attachment 288230 [details]) > My observations on > - For Assets and Liabilities, all bar charts just produce a blank page. While tweaking I sometimes got an empty chart. That is the chart is rendered with legend included but there's no data on it. I never got a completely blank page though. Did you also get a empty chart or really a blank page ?
Yes, I see completely blank canvases for asset bar charts. This also seems to be true for budget bar charts, but I have not tested as thoroughly. Ron (In reply to comment #14) > (In reply to comment #4) > > (From update of attachment 288230 [details] [details]) > > My observations on > > - For Assets and Liabilities, all bar charts just produce a blank page. > > While tweaking I sometimes got an empty chart. That is the chart is rendered > with legend included but there's no data on it. > > I never got a completely blank page though. > > Did you also get a empty chart or really a blank page ?
As said, I have pushed a commit to revert to the CategoryAxisRenderer instead of the DateAxisRenderer. For those capable of rebuilding gnucash, please test and give your feedback. Windows users can download the nightly build tomorrow (dated 2014-10-14) from http://code.gnucash.org/builds/win32/maint/ and test as well. The changes are all in one single scm script file. So if you don't know how to build gnucash, you can still test if you like by downloading https://raw.githubusercontent.com/Gnucash/gnucash/maint/src/report/report-system/html-barchart.scm and put it in <your gnucash install dir>/share/gnucash/scm/ And restart gnucash. Remember to back up the original html-barchart.scm you have in there first so you can revert to it. Of note: even with this modified file I keep getting charts with an empty canvas. To show the bars, I have to zoom in (select a region of the chart) and zoom out again (double-click in the chart area). This seems to happen only with stacked barcharts. Are others seeing this as well ?
(In reply to comment #15) > Yes, I see completely blank canvases for asset bar charts. This also seems to > be true for budget bar charts, but I have not tested as thoroughly. > > Ron > So that sounds like an additional issue with the bar charts. Is there anything in the trace file [1] ? [1] http://wiki.gnucash.org/wiki/Tracefile
With the new html-barchart.scm I have the same behaviour as you report. I seem to have correct bar charts after a zoom+unzoom.
Thanks for the feedback. That brings us at least one step closer already. What remains is to figure out why stacked bar charts only display after zoom+unzoom.
I'm seeing completely blank canvasses for two different net work charts on OS X (Mavericks), as well as screwed up stacked bars. Haven't had the chance to try the patch yet.
What's a "net work chart"? Does zooming and unzooming force the charts to draw?
Sorry about that, I was typing quickly - I'm talking about two versions of the "Net Worth Barchart" (I have one on a month scale and one on a year scale). Zooming does not seem to do anything. I'll also attach a screen grab of what my stacked bar chart for expenses is doing - it looks different than the others. What seems to be happening is the year is being recognized correctly, the month is being set to January, and the numerical month is being subbed in for the numerical date (if I slowly hover over the bars I see entries up to 12-Jan-2013 and 10-Jan-2014.
Created attachment 288869 [details] Stacked bars showing months transposed onto days of January
*** Bug 738910 has been marked as a duplicate of this bug. ***
(In reply to comment #20) > I'm seeing completely blank canvasses for two different net work charts on OS X > (Mavericks), as well as screwed up stacked bars. Haven't had the chance to try > the patch yet. Can you try the patch ? The blank canvasses were from before the patch. I also expect your stacked bar charts to be resolved by it.
I have just pushed an additional change to the file referred to above. With this change the empty canvas issue should be fixed. The root cause appears to be a bug in the jqplot library (unfixed in the latest stable version of that library): https://bitbucket.org/cleonello/jqplot/issue/587/charts-disappear-by-enabling-stackseries My change works around this bug. Can some of the affected people confirm this is now fixed ? Either by downloading tomorrow's nightly build, or by copying the patched file directly into your gnucash installation as explained in comment 16.
*** Bug 738950 has been marked as a duplicate of this bug. ***
I can confirm that all looks fine with the newest html-barcharts.scm file! Thank you for fixing!
The latest patch seems to work fine for me. I'll play around with it a bit later today and post any issues. Thanks for all the effort. It's appreciated.
Applying the patch manually and/or replacing the file on OS X in GnuCash.app/Contents/Resources/share/gnucash/scm isn't having an effect for me (still blank canvases for Net Worth Barchart, and the stacked bars look like the attached screenshot). Not sure if that's not where it's looking, or if the patch isn't working. I'm just prepping for an overseas assignment, so unfortunately I'm not going to have too much more time to fiddle.
(In reply to comment #30) > Applying the patch manually and/or replacing the file on OS X in > GnuCash.app/Contents/Resources/share/gnucash/scm isn't having an effect for me > (still blank canvases for Net Worth Barchart, and the stacked bars look like > the attached screenshot). Not sure if that's not where it's looking, or if the > patch isn't working. > > I'm just prepping for an overseas assignment, so unfortunately I'm not going to > have too much more time to fiddle. Ok, it looks like you are hitting yet another issue. What you didn't mention was if this worked in gnucash 2.6.3. And secondly can you check the gnucash trace [1] file for any error messages ? You should check this file right after you have run gnucash and generated the failing net worth charts. [1] http://wiki.gnucash.org/wiki/Tracefile
@Ron, Philipp: thanks for testing and confirming this fix works for you.
This was working for me on Gnucash 2.6.3 and versions back to the 1.x days. For each Net Worth bar char I get the error: MESSG <> console message: undefined @0: TypeError: 'undefined' is not a function Which seems to be related to the following function: function formatTooltip(str, seriesIndex, pointIndex) { if (options.axes.xaxis.ticks[pointIndex] !== undefined) x = options.axes.xaxis.ticks[pointIndex]; else x = pointIndex; y = data[seriesIndex][pointIndex][1].toFixed(2); return options.series[seriesIndex].label + ' ' + x + '<br><b>' + y + '</b>'; }
I can't reproduce this unfortunately... Are you willing to provide me with the report saved to html ? If you don't want to attach it to this bug report for privacy reasons (which I would understand) you can send it to me in private as well.
Oh, and if you do, please generate the report with the option "Show table" enabled. That gives me something to compare the chart with the data it should be working on.
*** Bug 739521 has been marked as a duplicate of this bug. ***
*** Bug 739236 has been marked as a duplicate of this bug. ***
*** Bug 741053 has been marked as a duplicate of this bug. ***
*** Bug 741638 has been marked as a duplicate of this bug. ***
*** Bug 738376 has been marked as a duplicate of this bug. ***
The bug persists in GnuCash 2.6.5. I'm using the tar ball available at gnucash.org (This copy was built from rev 23d0f79+ on 2015-02-24.) I've also applied the change to html-barchart.scm proposed in comment 16. Still, all but one coloured rectangles are replaced to the right. Besides, the bar are displayed centered on their respective date on the x-axis, instead of filling up the period between two dates. Are you still interested in the html output? (I suppose you mean file -> save as -> xml?!)
(In reply to Oliver C. from comment #41) > The bug persists in GnuCash 2.6.5. I'm using the tar ball available at > gnucash.org (This copy was built from rev 23d0f79+ on 2015-02-24.) I've also > applied the change to html-barchart.scm proposed in comment 16. Still, all > but one coloured rectangles are replaced to the right. > > Besides, the bar are displayed centered on their respective date on the > x-axis, instead of filling up the period between two dates. > > Are you still interested in the html output? (I suppose you mean file -> > save as -> xml?!) No, that would be File->Export->Export Report However I'd be surprised this would still happen in gnucash 2.6.5. The code responsible for it has been completely reverted. To rule out an obsolete guile compile cache can you remove the contents of $HOME/.cache/guile and try again ?
yes, that fixed it. Thanks a lot!
(In reply to mmacleod from comment #30) > Applying the patch manually and/or replacing the file on OS X in > GnuCash.app/Contents/Resources/share/gnucash/scm isn't having an effect for > me (still blank canvases for Net Worth Barchart, and the stacked bars look > like the attached screenshot). Not sure if that's not where it's looking, > or if the patch isn't working. > > I'm just prepping for an overseas assignment, so unfortunately I'm not going > to have too much more time to fiddle. mmacleod: are you still having this issue with the most recent gnucash release (2.6.6-3) ?
Hi Geert, I just returned home to my OS X machine after several months away, and was unable to get 2.6.6-4 to recognize my accounts file (separate issue). I installed 2.6.5-6 instead, and it loaded - and this particular bug has gone away. Thanks! Matt
Thank you for reporting back. I'll close this bug now.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=737815. Please update any external references or bookmarks.