mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[average-balance] upgraded
This commit is contained in:
parent
0f6f55e145
commit
aa175e0a93
@ -374,7 +374,7 @@
|
|||||||
;; make a plot (optionally)... if both plot and table,
|
;; make a plot (optionally)... if both plot and table,
|
||||||
;; plot comes first.
|
;; plot comes first.
|
||||||
(if show-plot?
|
(if show-plot?
|
||||||
(let ((barchart (gnc:make-html-barchart))
|
(let ((barchart (gnc:make-html-chart))
|
||||||
(height (get-option gnc:pagename-display optname-plot-height))
|
(height (get-option gnc:pagename-display optname-plot-height))
|
||||||
(width (get-option gnc:pagename-display optname-plot-width))
|
(width (get-option gnc:pagename-display optname-plot-width))
|
||||||
(col-labels '())
|
(col-labels '())
|
||||||
@ -386,30 +386,21 @@
|
|||||||
(lambda (row) (list-ref row 2)) data)))
|
(lambda (row) (list-ref row 2)) data)))
|
||||||
(if (not (every zero? number-data))
|
(if (not (every zero? number-data))
|
||||||
(begin
|
(begin
|
||||||
(gnc:html-barchart-append-column!
|
(gnc:html-chart-add-data-series! barchart
|
||||||
barchart
|
(list-ref columns 2)
|
||||||
number-data)
|
number-data
|
||||||
(set! col-labels
|
"#0074D9")
|
||||||
(append col-labels
|
|
||||||
(list (list-ref columns 2))))
|
|
||||||
(set! col-colors
|
|
||||||
(append col-colors (list "#0074D9")))
|
|
||||||
(set! all-zeros? #f)))))
|
(set! all-zeros? #f)))))
|
||||||
|
|
||||||
|
|
||||||
(if (memq 'GainPlot plot-type)
|
(if (memq 'GainPlot plot-type)
|
||||||
(let ((number-data
|
(let ((number-data
|
||||||
(map (lambda (row) (list-ref row 7)) data)))
|
(map (lambda (row) (list-ref row 7)) data)))
|
||||||
(if (not (every zero? number-data))
|
(if (not (every zero? number-data))
|
||||||
(begin
|
(begin
|
||||||
(gnc:html-barchart-append-column!
|
(gnc:html-chart-add-data-series! barchart
|
||||||
barchart
|
(list-ref columns 7)
|
||||||
number-data)
|
number-data
|
||||||
(set! col-labels
|
"#2ECC40")
|
||||||
(append col-labels
|
|
||||||
(list (list-ref columns 7))))
|
|
||||||
(set! col-colors
|
|
||||||
(append col-colors (list "#2ECC40")))
|
|
||||||
(set! all-zeros? #f)))))
|
(set! all-zeros? #f)))))
|
||||||
|
|
||||||
(if (memq 'GLPlot plot-type)
|
(if (memq 'GLPlot plot-type)
|
||||||
@ -422,40 +413,30 @@
|
|||||||
(every zero? debit-data)
|
(every zero? debit-data)
|
||||||
(every zero? credit-data)))
|
(every zero? credit-data)))
|
||||||
(begin
|
(begin
|
||||||
(gnc:html-barchart-append-column!
|
(gnc:html-chart-add-data-series! barchart
|
||||||
barchart
|
(list-ref columns 5)
|
||||||
debit-data)
|
debit-data
|
||||||
(set! col-labels
|
"#111111")
|
||||||
(append col-labels
|
(gnc:html-chart-add-data-series! barchart
|
||||||
(list (list-ref columns 5))))
|
(list-ref columns 6)
|
||||||
(set! col-colors
|
credit-data
|
||||||
(append col-colors (list "#111111")))
|
"#FF4136")
|
||||||
|
|
||||||
;; credit
|
|
||||||
(gnc:html-barchart-append-column!
|
|
||||||
barchart
|
|
||||||
credit-data)
|
|
||||||
(set! col-labels
|
|
||||||
(append col-labels
|
|
||||||
(list (list-ref columns 6))))
|
|
||||||
(set! col-colors
|
|
||||||
(append col-colors (list "#FF4136")))
|
|
||||||
(set! all-zeros? #f)))))
|
(set! all-zeros? #f)))))
|
||||||
|
|
||||||
(if (not all-zeros?)
|
(if (not all-zeros?)
|
||||||
(begin
|
(begin
|
||||||
(gnc:html-barchart-set-title! barchart report-title)
|
(gnc:html-chart-set-currency-iso!
|
||||||
(gnc:html-barchart-set-col-labels!
|
barchart (gnc-commodity-get-mnemonic report-currency))
|
||||||
barchart col-labels)
|
(gnc:html-chart-set-currency-symbol!
|
||||||
(gnc:html-barchart-set-col-colors!
|
barchart (gnc-commodity-get-nice-symbol report-currency))
|
||||||
barchart col-colors)
|
|
||||||
(gnc:html-barchart-set-row-labels!
|
(gnc:html-chart-set-data-labels! barchart col-labels)
|
||||||
barchart (map car data))
|
;; (gnc:html-barchart-set-col-colors! barchart col-colors)
|
||||||
(gnc:html-barchart-set-row-labels-rotated?! barchart #t)
|
(gnc:html-chart-set-data-labels! barchart (map car data))
|
||||||
|
;; (gnc:html-chart-set-row-labels-rotated?! barchart #t)
|
||||||
(gnc:html-barchart-set-width! barchart width)
|
(gnc:html-chart-set-width! barchart width)
|
||||||
(gnc:html-barchart-set-height! barchart height)
|
(gnc:html-chart-set-height! barchart height)
|
||||||
(gnc:html-barchart-set-height! barchart height)
|
(gnc:html-chart-set-height! barchart height)
|
||||||
(gnc:html-document-add-object! document barchart))
|
(gnc:html-document-add-object! document barchart))
|
||||||
(gnc:html-document-add-object!
|
(gnc:html-document-add-object!
|
||||||
document
|
document
|
||||||
|
Loading…
Reference in New Issue
Block a user