diff --git a/src/scm/report/account-piecharts.scm b/src/scm/report/account-piecharts.scm index a8193e0e2b..987abf7801 100644 --- a/src/scm/report/account-piecharts.scm +++ b/src/scm/report/account-piecharts.scm @@ -285,45 +285,41 @@ balance at a given time")) (set! other-anchor (gnc:report-anchor-text id))))) ;; set the URLs; the slices are links to other reports - (gnc:html-piechart-set-button-1-slice-urls! - chart - (map - (lambda (pair) - (if (string? (cadr pair)) - other-anchor - (let* ((acct (cadr pair)) - (subaccts - (gnc:account-get-immediate-subaccounts acct))) - (if (null? subaccts) - ;; if leaf-account, make this an anchor - ;; to the register. - (gnc:account-anchor-text (cadr pair)) - ;; if non-leaf account, make this a link - ;; to another report which is run on the - ;; immediate subaccounts of this account - ;; (and including this account). - (gnc:make-report-anchor - reportname - (gnc:report-options report-obj) - (list - (list gnc:pagename-accounts optname-accounts - (cons acct subaccts)) - (list gnc:pagename-accounts optname-levels - (+ 1 tree-depth)) - (list gnc:pagename-general - gnc:optname-reportname - ((if show-fullname? - gnc:account-get-full-name - gnc:account-get-name) acct)))))))) - combined)) - - (gnc:html-piechart-set-button-1-legend-urls! - chart (map - (lambda (pair) - (if (string? (cadr pair)) - other-anchor - (gnc:account-anchor-text (cadr pair)))) - combined)) + (let + ((urls + (map + (lambda (pair) + (if (string? (cadr pair)) + other-anchor + (let* ((acct (cadr pair)) + (subaccts + (gnc:account-get-immediate-subaccounts acct))) + (if (null? subaccts) + ;; if leaf-account, make this an anchor + ;; to the register. + (gnc:account-anchor-text (cadr pair)) + ;; if non-leaf account, make this a link + ;; to another report which is run on the + ;; immediate subaccounts of this account + ;; (and including this account). + (gnc:make-report-anchor + reportname + (gnc:report-options report-obj) + (list + (list gnc:pagename-accounts optname-accounts + (cons acct subaccts)) + (list gnc:pagename-accounts optname-levels + (+ 1 tree-depth)) + (list gnc:pagename-general + gnc:optname-reportname + ((if show-fullname? + gnc:account-get-full-name + gnc:account-get-name) acct)))))))) + combined))) + (gnc:html-piechart-set-button-1-slice-urls! + chart urls) + (gnc:html-piechart-set-button-1-legend-urls! + chart urls)) (gnc:html-piechart-set-title! chart report-title) @@ -350,7 +346,7 @@ balance at a given time")) ""))) - (let ((urls + (let ((legend-labels (map (lambda (pair) (string-append @@ -365,7 +361,7 @@ balance at a given time")) (gnc:amount->string (car pair) print-info)) ""))) combined))) - (gnc:html-piechart-set-labels! chart urls)) + (gnc:html-piechart-set-labels! chart legend-labels)) (gnc:html-document-add-object! document chart) @@ -376,8 +372,7 @@ balance at a given time")) document (gnc:make-html-text (gnc:html-markup-p - "Double-click on any legend box opens the register \ -to that account. Double-click on a pie slice opens either the \ + "Double-click on any legend box or pie slice opens either the \ register or, if the account has subaccounts, opens \ another piechart report with precisely those subaccounts.") (gnc:html-markup-p "Dragging with left button \ diff --git a/src/scm/report/category-barchart.scm b/src/scm/report/category-barchart.scm index 8b217b7139..362d932780 100644 --- a/src/scm/report/category-barchart.scm +++ b/src/scm/report/category-barchart.scm @@ -414,16 +414,10 @@ developing over time")) gnc:account-get-full-name gnc:account-get-name) acct)))))))) all-data))) - (gnc:html-barchart-set-button-1-bar-urls! chart (append urls urls))) - - ;; The legend urls always point to the registers. - (gnc:html-barchart-set-button-1-legend-urls! - chart (map - (lambda (pair) - (if (string? (car pair)) - other-anchor - (gnc:account-anchor-text (car pair)))) - all-data)) + (gnc:html-barchart-set-button-1-bar-urls! chart (append urls urls)) + ;; The legend urls do the same thing. + (gnc:html-barchart-set-button-1-legend-urls! chart + (append urls urls))) (gnc:html-document-add-object! document chart) @@ -439,10 +433,9 @@ lots of thin bars next to each other for each date, then you \ should upgrade Guppi to version 0.35.4 or, \ if that isn't out yet, use the Guppi CVS version.") (gnc:html-markup-p - "Double-click on any legend box opens the register \ -to that account. Double-click on a bar opens either the \ -register or, if the account has subaccounts, opens \ -another barchart report with precisely those subaccounts.") + "Double-click on any legend box or any bar opens \ +another barchart report with the subaccounts of that account or, \ +if that account doesn't have subaccounts, the register for the account.") (gnc:html-markup-p "Remove this text by disabling \ the global Preference \"Display Tip of the Day\"."))))