After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726449 - Budget Barchart does not show up if running sum is selected
Budget Barchart does not show up if running sum is selected
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Reports
2.6.2
Other Linux
: Normal major
: ---
Assigned To: gnucash-reports-maint
gnucash-reports-maint
Depends on:
Blocks:
 
 
Reported: 2014-03-16 10:58 UTC by Carsten Rinke
Modified: 2018-06-29 23:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to be applied on top of GnuCash 2.6.2 (2.45 KB, patch)
2014-03-16 11:11 UTC, Carsten Rinke
needs-work Details | Review
Patch to be applied on GnuCash 2.6.2 or later (3.61 KB, patch)
2014-03-17 18:34 UTC, Carsten Rinke
none Details | Review
patch to be applied on top of GnuCash 2.6.2 (1.58 KB, patch)
2014-03-23 19:03 UTC, Carsten Rinke
none Details | Review
patch to be applied on top of GnuCash 2.6.2 - version 2 (1.69 KB, patch)
2014-03-23 19:05 UTC, Carsten Rinke
reviewed Details | Review
Patch to be applied on GnuCash 2.6.3 or later - version 3 (6.78 KB, patch)
2014-04-07 18:28 UTC, Carsten Rinke
committed Details | Review

Description Carsten Rinke 2014-03-16 10:58:33 UTC
When starting the Budget Barchart Report a white empty scree is returned.

Go to the report options, deactivate the running sum, try again, the the bar chart is coming up as expected - without the running sum, of course.
Comment 1 Carsten Rinke 2014-03-16 11:11:12 UTC
Created attachment 272052 [details] [review]
patch to be applied on top of GnuCash 2.6.2

For the running sum the chart is extended with a subtitle.

The subtitle composition includes a backslash character.
After taking out the backslash character the bar chart comes up as expected.

As I do no see the need and the benefit for this character, I simply propose to delete it.
This is what the patch is doing.

Apart from that, I took the freedom to insert a footer for revision handling and showing a time stamp for the report creation.
Comment 2 Geert Janssens 2014-03-17 16:46:39 UTC
Comment on attachment 272052 [details] [review]
patch to be applied on top of GnuCash 2.6.2

Thank you for your report.

The "backslash character" is not just a backslash - it's \n, which means a newline. I agree it's probably not correct to add it like this in a report. The original author's intention no doubt was to put the Act string on a new line. The proper way to do so would have been by adding a <br/> html tag.

I don't use the report so I'll leave it up to you which way is better.

I have some issue with the added footer though. I can't imagine it would be desirable in all cases to add this information. I can see it useful in some circumstances but I don't want to enforce this at all times. Can you make this addition optional, please ?

Thank you.
Comment 3 Carsten Rinke 2014-03-17 18:34:18 UTC
Created attachment 272193 [details] [review]
Patch to be applied on GnuCash 2.6.2 or later

Hi Geert,

no problem. See new attachment, the report footprint is now optional.

But:
I tried
- <br/>
- </br>
- <br>
and none of these versions took effect, they where all just added as plain text.

Seems to be more complex than I currently can grasp.
I would prefer to shift this line break issue to a later point of time by creating another bug for it.
Comment 4 Carsten Rinke 2014-03-23 19:03:19 UTC
Created attachment 272706 [details] [review]
patch to be applied on top of GnuCash 2.6.2

Hi Geert,

I think now I found the place to make it work as before, see attach patch.
Comment 5 Carsten Rinke 2014-03-23 19:05:28 UTC
Created attachment 272707 [details] [review]
patch to be applied on top of GnuCash 2.6.2 - version 2

however, I think this versions provides better readability

feel free to choose :-)
Comment 6 Geert Janssens 2014-04-04 19:58:54 UTC
Comment on attachment 272707 [details] [review]
patch to be applied on top of GnuCash 2.6.2 - version 2

Thank you for your patch(es).

You may think I'm doing this intentionally but... I have a small remark.

Your patch drops the call to jqplot-escape-string on the substring. I can follow this because it is the only way to preserve the br html tag to pass.

This does put the burden of generating a javascript compatible string for the subtitle on the calling script. This means the calling script should make sure the generated subtitle doesn't contain any unescaped quotes or backslashes. Otherwise we're opening the gates again for bug 721768.

Can you double-check that none of the reports that call gnc:html-barchart-set-subtitle can unintentionally create subtitles containing the above illegal characters ? The safest way to do so is probably to wrap all variables in a jqplot-escape-string. Like in your patch example:
(string-append "Bgt:" 
               (jqplot-escape-string (number->string bgt-sum))
               "<br /> Act:"
               (jqplot-escape-string (number->string act-sum)))))

You may have to load to proper scm module to get access to this function.

In addition, please add a big fat warning to the definition of gnc:html-barchart-set-subtitle to explain it will not be escaped like the title and labels will be.
Comment 7 Carsten Rinke 2014-04-07 18:28:35 UTC
Created attachment 273739 [details] [review]
Patch to be applied on GnuCash 2.6.3 or later - version 3

Hi Geert,

I hope this is somewhat close to what you have mind.
Comment 8 Geert Janssens 2014-04-21 10:15:11 UTC
Comment on attachment 273739 [details] [review]
Patch to be applied on GnuCash 2.6.3 or later - version 3

Thanks Carsten. Applied in https://github.com/Gnucash/gnucash/commit/5baa87bf
Comment 9 John Ralls 2018-06-29 23:28:23 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=726449. Please update any external references or bookmarks.