From 9d535f045c6a388e30892b603d64533bddee7a50 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Wed, 20 Feb 2013 18:51:04 +0000 Subject: [PATCH] Improve barchart - drop goffice based chart, only keep jquery one - move legend outside of plotting area git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22791 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/report/report-system/html-barchart.scm | 122 +++------------------ 1 file changed, 15 insertions(+), 107 deletions(-) diff --git a/src/report/report-system/html-barchart.scm b/src/report/report-system/html-barchart.scm index 5cf706e787..36a6b0cfe4 100644 --- a/src/report/report-system/html-barchart.scm +++ b/src/report/report-system/html-barchart.scm @@ -142,6 +142,14 @@ ;; used for all of the rows. Otherwise we could have cols*rows urls ;; (quite a lot), but this first requires fixing ;; guppi_bar_1_callback() in gnome/gnc-html-guppi.c . +;; FIXME url's haven't been working since GnuCash 1.x +;; GnuCash 2.x switched from guppy to goffice, which +;; made it very hard to remain the url functionality +;; At this point I (gjanssens) is in the process of +;; moving from goffice to jqplot for our charts +;; which perhaps may allow urls again in the charts +;; I'm keeping the parameters below around to remind +;; us this still has to be investigated again (define gnc:html-barchart-button-1-bar-urls (record-accessor 'button-1-bar-urls)) @@ -352,7 +360,7 @@ (push ");\n")))) (if (and (list? data) (not (null? data)) - (gnc:not-all-zeros data)) + (gnc:not-all-zeros data)) (begin (push (gnc:html-js-include "jqplot/jquery.min.js")) (push (gnc:html-js-include "jqplot/jquery.jqplot.js")) @@ -394,7 +402,9 @@ (push "var options = { shadowAlpha: 0.07, stackSeries: false, - legend: { show: true, }, + legend: { + show: true, + placement: \"outsideGrid\", }, seriesDefaults: { renderer: $.jqplot.BarRenderer, rendererOptions: { @@ -520,110 +530,8 @@ (gnc:msg (string-join (reverse (map (lambda (e) (if (number? e) (number->string e) e)) retval)) "")) - (push "\n") - (if title - (begin - (push " \n"))) - (if subtitle - (begin - (push " \n"))) - (if url-1 - (begin - (push " \n"))) - (if url-2 - (begin - (push " \n"))) - (if url-3 - (begin - (push " \n"))) - (if legend-1 - (begin - (push " \n"))) - (if legend-2 - (begin - (push " \n"))) - (if legend-3 - (begin - (push " \n"))) - (if (and data (list? data)) - (let ((rows (length data)) - (cols 0)) - (push " \n") - (if (list? (car data)) - (begin - (set! cols (length (car data))) - (push " \n"))) - (push " \n"))) - (if (and (string? x-label) (> (string-length x-label) 0)) - (begin - (push " \n"))) - (if (and (string? y-label) (> (string-length y-label) 0)) - (begin - (push " \n"))) - (if (and (string? col-colors) (> (string-length col-colors) 0)) - (begin - (push " \n"))) - (if (and (string? row-labels) (> (string-length row-labels) 0)) - (begin - (push " \n"))) - (if (and (string? col-labels) (> (string-length col-labels) 0)) - (begin - (push " \n"))) - (push " \n" - "0\">\n")) - (push " \n" - "0\">\n")) - (push " \n" - "0\">\n")) - (push "Unable to push bar chart\n") - (push "  \n")) + ) (begin - (gnc:warn "barchart has no non-zero data.") - " ")) + (gnc:warn "barchart has no non-zero data.") + " ")) retval))