mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2001-04-30 Christian Stimming <stimming@tuhh.de>
* src/scm/report/net-worth-timeseries.scm, income-expense-chart.scm: removed files. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4084 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e68c1d5046
commit
5d0ecdc6ad
@ -1,3 +1,8 @@
|
|||||||
|
2001-04-30 Christian Stimming <stimming@tuhh.de>
|
||||||
|
|
||||||
|
* src/scm/report/net-worth-timeseries.scm,
|
||||||
|
income-expense-chart.scm: removed files.
|
||||||
|
|
||||||
2001-04-29 Dave Peticolas <dave@krondo.com>
|
2001-04-29 Dave Peticolas <dave@krondo.com>
|
||||||
|
|
||||||
* src/gnc-ui-util.c (gnc_locale_default_currency): handle no
|
* src/gnc-ui-util.c (gnc_locale_default_currency): handle no
|
||||||
|
@ -9,9 +9,7 @@ gncscm_DATA = \
|
|||||||
category-barchart.scm \
|
category-barchart.scm \
|
||||||
hello-world.scm \
|
hello-world.scm \
|
||||||
iframe-url.scm \
|
iframe-url.scm \
|
||||||
income-expense-graph.scm \
|
|
||||||
net-barchart.scm \
|
net-barchart.scm \
|
||||||
net-worth-timeseries.scm \
|
|
||||||
pnl.scm \
|
pnl.scm \
|
||||||
portfolio.scm \
|
portfolio.scm \
|
||||||
register.scm \
|
register.scm \
|
||||||
|
@ -1,236 +0,0 @@
|
|||||||
;; -*-scheme-*-
|
|
||||||
|
|
||||||
;; income-expense-graph.scm
|
|
||||||
;; Display a simple time series for graphs
|
|
||||||
;; by Robert Merkel (rgmerk@mira.net)
|
|
||||||
|
|
||||||
(gnc:support "report/income-expense-graph.scm")
|
|
||||||
(gnc:depend "report-html.scm")
|
|
||||||
(gnc:depend "date-utilities.scm")
|
|
||||||
|
|
||||||
(let ((optname-from-date (N_ "From"))
|
|
||||||
(optname-to-date (N_ "To"))
|
|
||||||
(optname-stepsize (N_ "Step Size"))
|
|
||||||
(optname-report-currency (N_ "Report's currency"))
|
|
||||||
|
|
||||||
(optname-accounts (N_ "Accounts"))
|
|
||||||
|
|
||||||
(optname-inc-exp (N_ "Show Income/Expense"))
|
|
||||||
(optname-show-profit (N_ "Show Net Profit"))
|
|
||||||
(optname-stacked (N_ "Use Stacked Bars"))
|
|
||||||
(optname-plot-width (N_ "Plot Width"))
|
|
||||||
(optname-plot-height (N_ "Plot Height")))
|
|
||||||
|
|
||||||
(define (options-generator)
|
|
||||||
(let* ((options (gnc:new-options))
|
|
||||||
;; This is just a helper function for making options.
|
|
||||||
;; See gnucash/src/scm/options.scm for details.
|
|
||||||
(add-option
|
|
||||||
(lambda (new-option)
|
|
||||||
(gnc:register-option options new-option))))
|
|
||||||
|
|
||||||
(gnc:options-add-date-interval!
|
|
||||||
options gnc:pagename-general
|
|
||||||
optname-from-date optname-to-date "a")
|
|
||||||
|
|
||||||
(gnc:options-add-interval-choice!
|
|
||||||
options gnc:pagename-general optname-stepsize "b" 'MonthDelta)
|
|
||||||
|
|
||||||
(add-option
|
|
||||||
(gnc:make-account-list-option
|
|
||||||
gnc:pagename-accounts optname-accounts
|
|
||||||
"c"
|
|
||||||
(N_ "Report on these accounts, if chosen account level allows.")
|
|
||||||
(lambda ()
|
|
||||||
(filter
|
|
||||||
gnc:account-is-inc-exp?
|
|
||||||
(gnc:group-get-subaccounts (gnc:get-current-group))))
|
|
||||||
(lambda (accounts)
|
|
||||||
(list #t
|
|
||||||
(filter gnc:account-is-inc-exp? accounts)))
|
|
||||||
#t))
|
|
||||||
|
|
||||||
(gnc:options-add-currency!
|
|
||||||
options gnc:pagename-general optname-report-currency "d")
|
|
||||||
|
|
||||||
(add-option
|
|
||||||
(gnc:make-simple-boolean-option
|
|
||||||
gnc:pagename-display optname-inc-exp
|
|
||||||
"a" (N_ "Show Income and Expenses?") #t))
|
|
||||||
|
|
||||||
(add-option
|
|
||||||
(gnc:make-simple-boolean-option
|
|
||||||
gnc:pagename-display optname-show-profit
|
|
||||||
"b" (N_ "Show the net profit?") #f))
|
|
||||||
|
|
||||||
(add-option
|
|
||||||
(gnc:make-simple-boolean-option
|
|
||||||
gnc:pagename-display optname-stacked
|
|
||||||
"ba" (N_ "Show barchart as stacked barchart?") #f))
|
|
||||||
|
|
||||||
(gnc:options-add-plot-size!
|
|
||||||
options gnc:pagename-display
|
|
||||||
optname-plot-width optname-plot-height "c" 400 400)
|
|
||||||
|
|
||||||
(gnc:options-set-default-section options gnc:pagename-general)
|
|
||||||
|
|
||||||
options))
|
|
||||||
|
|
||||||
;; This is the rendering function. It accepts a database of options
|
|
||||||
;; and generates an object of type <html-document>. See the file
|
|
||||||
;; report-html.txt for documentation; the file report-html.scm
|
|
||||||
;; includes all the relevant Scheme code. The option database passed
|
|
||||||
;; to the function is one created by the options-generator function
|
|
||||||
;; defined above.
|
|
||||||
(define (inc-exp-graph-renderer report-obj)
|
|
||||||
|
|
||||||
;; These are some helper functions for looking up option values.
|
|
||||||
(define (get-op section name)
|
|
||||||
(gnc:lookup-option (gnc:report-options report-obj) section name))
|
|
||||||
|
|
||||||
(define (op-value section name)
|
|
||||||
(gnc:option-value (get-op section name)))
|
|
||||||
|
|
||||||
(define (collector-fn accounts income?)
|
|
||||||
(lambda (date-list-entry)
|
|
||||||
(let ((start-date (car date-list-entry))
|
|
||||||
(end-date (cadr date-list-entry)))
|
|
||||||
((if income?
|
|
||||||
gnc:accounts-get-comm-total-income
|
|
||||||
gnc:accounts-get-comm-total-expense)
|
|
||||||
accounts
|
|
||||||
(lambda (account)
|
|
||||||
(gnc:account-get-comm-balance-interval account
|
|
||||||
start-date
|
|
||||||
end-date
|
|
||||||
#f))))))
|
|
||||||
|
|
||||||
(define (collector-to-double-fn report-currency exchange-fn)
|
|
||||||
(lambda (commodity-collector)
|
|
||||||
(gnc:numeric-to-double
|
|
||||||
(gnc:gnc-monetary-amount
|
|
||||||
(gnc:sum-collector-commodity commodity-collector
|
|
||||||
report-currency
|
|
||||||
exchange-fn)))))
|
|
||||||
|
|
||||||
(let* ((to-date-tp (gnc:timepair-end-day-time
|
|
||||||
(gnc:date-option-absolute-time
|
|
||||||
(op-value gnc:pagename-general
|
|
||||||
optname-to-date))))
|
|
||||||
(from-date-tp (gnc:timepair-start-day-time
|
|
||||||
(gnc:date-option-absolute-time
|
|
||||||
(op-value gnc:pagename-general
|
|
||||||
optname-from-date))))
|
|
||||||
(interval (op-value gnc:pagename-general optname-stepsize))
|
|
||||||
(accounts (op-value gnc:pagename-accounts optname-accounts))
|
|
||||||
(report-currency (op-value gnc:pagename-general
|
|
||||||
optname-report-currency))
|
|
||||||
|
|
||||||
(show-net? (op-value gnc:pagename-display optname-show-profit))
|
|
||||||
(show-incexp? (op-value gnc:pagename-display optname-inc-exp))
|
|
||||||
(stacked? (op-value gnc:pagename-display optname-stacked))
|
|
||||||
(height (op-value gnc:pagename-display optname-plot-height))
|
|
||||||
(width (op-value gnc:pagename-display optname-plot-width))
|
|
||||||
|
|
||||||
(document (gnc:make-html-document))
|
|
||||||
(chart (gnc:make-html-barchart))
|
|
||||||
(exchange-alist (gnc:make-exchange-alist
|
|
||||||
report-currency to-date-tp))
|
|
||||||
(exchange-fn-internal (gnc:make-exchange-function exchange-alist))
|
|
||||||
(exchange-fn (lambda (foreign)
|
|
||||||
(exchange-fn-internal foreign report-currency)))
|
|
||||||
(dates-list (gnc:make-date-interval-list
|
|
||||||
(gnc:timepair-start-day-time from-date-tp)
|
|
||||||
(gnc:timepair-end-day-time to-date-tp)
|
|
||||||
(eval interval)))
|
|
||||||
(income-collector-fn (collector-fn accounts #t))
|
|
||||||
(expense-collector-fn (collector-fn accounts #f))
|
|
||||||
(income-collector-list (map income-collector-fn dates-list))
|
|
||||||
(expense-collector-list (map expense-collector-fn dates-list))
|
|
||||||
(income-list
|
|
||||||
(map (collector-to-double-fn report-currency exchange-fn-internal)
|
|
||||||
income-collector-list))
|
|
||||||
(expense-list
|
|
||||||
(map (collector-to-double-fn report-currency exchange-fn-internal)
|
|
||||||
expense-collector-list))
|
|
||||||
(date-string-list
|
|
||||||
(map (lambda (date-list-item)
|
|
||||||
(gnc:timepair-to-datestring
|
|
||||||
(car date-list-item)))
|
|
||||||
dates-list)))
|
|
||||||
|
|
||||||
(gnc:html-barchart-set-title! chart (_ "Income/Expense Chart"))
|
|
||||||
(gnc:html-barchart-set-subtitle!
|
|
||||||
chart (sprintf #f
|
|
||||||
(_ "%s to %s")
|
|
||||||
(gnc:timepair-to-datestring from-date-tp)
|
|
||||||
(gnc:timepair-to-datestring to-date-tp)))
|
|
||||||
(gnc:html-barchart-set-width! chart width)
|
|
||||||
(gnc:html-barchart-set-height! chart height)
|
|
||||||
(gnc:html-barchart-set-row-labels! chart date-string-list)
|
|
||||||
(gnc:html-barchart-set-y-axis-label!
|
|
||||||
chart (gnc:commodity-get-mnemonic report-currency))
|
|
||||||
(gnc:html-barchart-set-row-labels-rotated?! chart #t)
|
|
||||||
(gnc:html-barchart-set-stacked?! chart stacked?)
|
|
||||||
|
|
||||||
(if show-incexp?
|
|
||||||
(begin
|
|
||||||
(gnc:html-barchart-append-column! chart income-list)
|
|
||||||
(gnc:html-barchart-append-column! chart (map - expense-list))))
|
|
||||||
(if show-net?
|
|
||||||
(gnc:html-barchart-append-column!
|
|
||||||
chart (map + income-list expense-list)))
|
|
||||||
(gnc:html-barchart-set-col-labels!
|
|
||||||
chart (append
|
|
||||||
(if show-incexp?
|
|
||||||
(list (_ "Income") (_ "Expense")) '())
|
|
||||||
(if show-net?
|
|
||||||
(list (_ "Net Profit")) '())))
|
|
||||||
(gnc:html-barchart-set-col-colors!
|
|
||||||
chart (append
|
|
||||||
(if show-incexp?
|
|
||||||
'("blue" "red") '())
|
|
||||||
(if show-net?
|
|
||||||
'("green") '())))
|
|
||||||
|
|
||||||
(if show-incexp?
|
|
||||||
(let ((urls
|
|
||||||
(list
|
|
||||||
(gnc:make-report-anchor
|
|
||||||
"Income Over Time"
|
|
||||||
report-obj
|
|
||||||
(list
|
|
||||||
(list gnc:pagename-display
|
|
||||||
"Use Stacked Bars" #t)
|
|
||||||
(list gnc:pagename-general
|
|
||||||
gnc:optname-reportname
|
|
||||||
(_ "Income Chart"))))
|
|
||||||
(gnc:make-report-anchor
|
|
||||||
"Expense Over Time"
|
|
||||||
report-obj
|
|
||||||
(list
|
|
||||||
(list gnc:pagename-display
|
|
||||||
"Use Stacked Bars" #t)
|
|
||||||
(list gnc:pagename-general
|
|
||||||
gnc:optname-reportname
|
|
||||||
(_ "Expense Chart")))))))
|
|
||||||
(gnc:html-barchart-set-button-1-bar-urls!
|
|
||||||
chart urls)
|
|
||||||
(gnc:html-barchart-set-button-1-legend-urls!
|
|
||||||
chart urls)))
|
|
||||||
|
|
||||||
(gnc:html-document-add-object! document chart)
|
|
||||||
|
|
||||||
document))
|
|
||||||
|
|
||||||
;; Here we define the actual report with gnc:define-report
|
|
||||||
(gnc:define-report
|
|
||||||
'version 1
|
|
||||||
|
|
||||||
'name (N_ "Income/Expense Chart")
|
|
||||||
|
|
||||||
'menu-path (list gnc:menuname-income-expense)
|
|
||||||
|
|
||||||
'options-generator options-generator
|
|
||||||
|
|
||||||
'renderer inc-exp-graph-renderer))
|
|
@ -331,14 +331,14 @@
|
|||||||
;; Here we define the actual report
|
;; Here we define the actual report
|
||||||
(gnc:define-report
|
(gnc:define-report
|
||||||
'version 1
|
'version 1
|
||||||
'name (N_ "Net Worth Barchart2")
|
'name (N_ "Net Worth Barchart")
|
||||||
'menu-path (list gnc:menuname-asset-liability)
|
'menu-path (list gnc:menuname-asset-liability)
|
||||||
'options-generator (lambda () (options-generator #f))
|
'options-generator (lambda () (options-generator #f))
|
||||||
'renderer (lambda (report-obj) (net-renderer report-obj #f)))
|
'renderer (lambda (report-obj) (net-renderer report-obj #f)))
|
||||||
|
|
||||||
(gnc:define-report
|
(gnc:define-report
|
||||||
'version 1
|
'version 1
|
||||||
'name (N_ "Income/Expense Chart2")
|
'name (N_ "Income/Expense Chart")
|
||||||
'menu-path (list gnc:menuname-income-expense)
|
'menu-path (list gnc:menuname-income-expense)
|
||||||
'options-generator (lambda () (options-generator #t))
|
'options-generator (lambda () (options-generator #t))
|
||||||
'renderer (lambda (report-obj) (net-renderer report-obj #t))))
|
'renderer (lambda (report-obj) (net-renderer report-obj #t))))
|
||||||
|
@ -1,254 +0,0 @@
|
|||||||
;; -*-scheme-*-
|
|
||||||
|
|
||||||
;; net-worth-timeseries.scm
|
|
||||||
;; Display a simple time series for net worth
|
|
||||||
;; by Robert Merkel (rgmerk@mira.net)
|
|
||||||
|
|
||||||
(gnc:support "report/net-worth-timeseries.scm")
|
|
||||||
(gnc:depend "report-html.scm")
|
|
||||||
(gnc:depend "date-utilities.scm")
|
|
||||||
|
|
||||||
(let ((optname-from-date (N_ "From"))
|
|
||||||
(optname-to-date (N_ "To"))
|
|
||||||
(optname-stepsize (N_ "Step Size"))
|
|
||||||
(optname-report-currency (N_ "Report's currency"))
|
|
||||||
|
|
||||||
(optname-accounts (N_ "Accounts"))
|
|
||||||
|
|
||||||
(optname-sep-bars (N_ "Show Asset & Liability bars"))
|
|
||||||
(optname-net-bars (N_ "Show net worth bars"))
|
|
||||||
(optname-plot-width (N_ "Plot Width"))
|
|
||||||
(optname-plot-height (N_ "Plot Height")))
|
|
||||||
|
|
||||||
(define (options-generator)
|
|
||||||
(let* ((options (gnc:new-options))
|
|
||||||
;; This is just a helper function for making options.
|
|
||||||
;; See gnucash/src/scm/options.scm for details.
|
|
||||||
(add-option
|
|
||||||
(lambda (new-option)
|
|
||||||
(gnc:register-option options new-option))))
|
|
||||||
|
|
||||||
(gnc:options-add-date-interval!
|
|
||||||
options gnc:pagename-general
|
|
||||||
optname-from-date optname-to-date "a")
|
|
||||||
|
|
||||||
(gnc:options-add-interval-choice!
|
|
||||||
options gnc:pagename-general optname-stepsize "b" 'MonthDelta)
|
|
||||||
|
|
||||||
(add-option
|
|
||||||
(gnc:make-account-list-option
|
|
||||||
gnc:pagename-accounts optname-accounts
|
|
||||||
"c"
|
|
||||||
(N_ "Report on these accounts, if chosen account level allows.")
|
|
||||||
(lambda ()
|
|
||||||
(filter
|
|
||||||
(lambda (account) (not (gnc:account-is-inc-exp? account)))
|
|
||||||
(gnc:group-get-subaccounts (gnc:get-current-group))))
|
|
||||||
(lambda (accounts)
|
|
||||||
(list #t
|
|
||||||
(filter (lambda (account)
|
|
||||||
(not (gnc:account-is-inc-exp? account)))
|
|
||||||
accounts)))
|
|
||||||
#t))
|
|
||||||
|
|
||||||
(gnc:options-add-currency!
|
|
||||||
options gnc:pagename-general optname-report-currency "d")
|
|
||||||
|
|
||||||
(add-option
|
|
||||||
(gnc:make-simple-boolean-option
|
|
||||||
gnc:pagename-display optname-sep-bars
|
|
||||||
"a" (N_ "Show the Asset and the Liability/Equity bars?") #t))
|
|
||||||
|
|
||||||
(add-option
|
|
||||||
(gnc:make-simple-boolean-option
|
|
||||||
gnc:pagename-display optname-net-bars
|
|
||||||
"b" (N_ "Show a Net Worth bar?") #t))
|
|
||||||
|
|
||||||
|
|
||||||
(gnc:options-add-plot-size!
|
|
||||||
options gnc:pagename-display
|
|
||||||
optname-plot-width optname-plot-height "c" 500 400)
|
|
||||||
|
|
||||||
(gnc:options-set-default-section options gnc:pagename-general)
|
|
||||||
|
|
||||||
options))
|
|
||||||
|
|
||||||
;; This is the rendering function. It accepts a database of options
|
|
||||||
;; and generates an object of type <html-document>. See the file
|
|
||||||
;; report-html.txt for documentation; the file report-html.scm
|
|
||||||
;; includes all the relevant Scheme code. The option database passed
|
|
||||||
;; to the function is one created by the options-generator function
|
|
||||||
;; defined above.
|
|
||||||
(define (net-worth-series-renderer report-obj)
|
|
||||||
|
|
||||||
;; These are some helper functions for looking up option values.
|
|
||||||
(define (get-op section name)
|
|
||||||
(gnc:lookup-option (gnc:report-options report-obj) section name))
|
|
||||||
|
|
||||||
(define (op-value section name)
|
|
||||||
(gnc:option-value (get-op section name)))
|
|
||||||
|
|
||||||
(define (collector-fn accounts dates)
|
|
||||||
(define (single-account-get-balance account tp)
|
|
||||||
(begin
|
|
||||||
(gnc:debug "account" account)
|
|
||||||
(gnc:debug "tp" tp)
|
|
||||||
(gnc:account-get-comm-balance-at-date
|
|
||||||
account tp #f)))
|
|
||||||
(define (accounts-get-balance tp the-accounts)
|
|
||||||
(gnc:accounts-get-comm-total-assets
|
|
||||||
the-accounts (lambda (account)
|
|
||||||
(single-account-get-balance account tp))))
|
|
||||||
|
|
||||||
(map (lambda (date) (accounts-get-balance date accounts))
|
|
||||||
dates))
|
|
||||||
|
|
||||||
|
|
||||||
(define (collector-to-double-fn report-currency exchange-fn)
|
|
||||||
(lambda (commodity-collector)
|
|
||||||
(gnc:numeric-to-double
|
|
||||||
(gnc:gnc-monetary-amount
|
|
||||||
(gnc:sum-collector-commodity commodity-collector
|
|
||||||
report-currency
|
|
||||||
exchange-fn)))))
|
|
||||||
|
|
||||||
(define (collector-combine asset-collector liability-collector)
|
|
||||||
(let ((new-collector (gnc:make-commodity-collector)))
|
|
||||||
(new-collector 'merge asset-collector #f)
|
|
||||||
(new-collector 'merge liability-collector #f)
|
|
||||||
new-collector))
|
|
||||||
|
|
||||||
|
|
||||||
(let* ((to-date-tp (gnc:timepair-end-day-time
|
|
||||||
(gnc:date-option-absolute-time
|
|
||||||
(op-value gnc:pagename-general optname-to-date))))
|
|
||||||
(from-date-tp (gnc:timepair-start-day-time
|
|
||||||
(gnc:date-option-absolute-time
|
|
||||||
(op-value gnc:pagename-general optname-from-date))))
|
|
||||||
(interval (op-value gnc:pagename-general optname-stepsize))
|
|
||||||
(accounts (op-value gnc:pagename-accounts optname-accounts))
|
|
||||||
(classified-accounts (gnc:decompose-accountlist accounts))
|
|
||||||
(asset-accounts
|
|
||||||
(assoc-ref classified-accounts 'asset))
|
|
||||||
(liability-equity-accounts
|
|
||||||
(append
|
|
||||||
(assoc-ref classified-accounts 'liability)
|
|
||||||
(assoc-ref classified-accounts 'equity)))
|
|
||||||
(report-currency (op-value gnc:pagename-general
|
|
||||||
optname-report-currency))
|
|
||||||
|
|
||||||
(show-sep? (op-value gnc:pagename-display optname-sep-bars))
|
|
||||||
(show-net? (op-value gnc:pagename-display optname-net-bars))
|
|
||||||
(height (op-value gnc:pagename-display optname-plot-height))
|
|
||||||
(width (op-value gnc:pagename-display optname-plot-width))
|
|
||||||
|
|
||||||
(document (gnc:make-html-document))
|
|
||||||
(chart (gnc:make-html-barchart))
|
|
||||||
(exchange-alist (gnc:make-exchange-alist
|
|
||||||
report-currency to-date-tp))
|
|
||||||
(exchange-fn-internal (gnc:make-exchange-function exchange-alist))
|
|
||||||
(exchange-fn (lambda (foreign)
|
|
||||||
(exchange-fn-internal foreign report-currency)))
|
|
||||||
(dates-list (gnc:make-date-list
|
|
||||||
(gnc:timepair-end-day-time from-date-tp)
|
|
||||||
(gnc:timepair-end-day-time to-date-tp)
|
|
||||||
(eval interval)))
|
|
||||||
(assets-collector-list (collector-fn asset-accounts dates-list))
|
|
||||||
(expense-collector-list
|
|
||||||
(collector-fn liability-equity-accounts dates-list))
|
|
||||||
(net-collector-list
|
|
||||||
(map collector-combine assets-collector-list
|
|
||||||
expense-collector-list))
|
|
||||||
(assets-list
|
|
||||||
(map (collector-to-double-fn report-currency exchange-fn-internal)
|
|
||||||
assets-collector-list))
|
|
||||||
(liability-list
|
|
||||||
(map (collector-to-double-fn report-currency exchange-fn-internal)
|
|
||||||
expense-collector-list))
|
|
||||||
(net-list
|
|
||||||
(map (collector-to-double-fn report-currency exchange-fn-internal)
|
|
||||||
net-collector-list))
|
|
||||||
(date-string-list
|
|
||||||
(map gnc:timepair-to-datestring
|
|
||||||
dates-list)))
|
|
||||||
|
|
||||||
(gnc:html-barchart-set-title! chart (_ "Net Worth Chart"))
|
|
||||||
(gnc:html-barchart-set-subtitle!
|
|
||||||
chart (sprintf #f
|
|
||||||
(_ "%s to %s")
|
|
||||||
(gnc:timepair-to-datestring from-date-tp)
|
|
||||||
(gnc:timepair-to-datestring to-date-tp)))
|
|
||||||
(gnc:html-barchart-set-width! chart width)
|
|
||||||
(gnc:html-barchart-set-height! chart height)
|
|
||||||
(gnc:html-barchart-set-row-labels! chart date-string-list)
|
|
||||||
(gnc:html-barchart-set-y-axis-label!
|
|
||||||
chart (gnc:commodity-get-mnemonic report-currency))
|
|
||||||
;; Determine whether we have enough space for horizontal labels
|
|
||||||
;; -- kind of a hack. Assumptions: y-axis labels and legend
|
|
||||||
;; require 200 pixels, and each x-axes label needs 60 pixels.
|
|
||||||
(gnc:html-barchart-set-row-labels-rotated?!
|
|
||||||
chart (< (/ (- width 200)
|
|
||||||
(length date-string-list)) 60))
|
|
||||||
|
|
||||||
(if show-sep?
|
|
||||||
(begin
|
|
||||||
(gnc:html-barchart-append-column! chart assets-list)
|
|
||||||
(gnc:html-barchart-append-column! chart liability-list)))
|
|
||||||
(if show-net?
|
|
||||||
(gnc:html-barchart-append-column!
|
|
||||||
chart net-list))
|
|
||||||
(gnc:html-barchart-set-col-labels!
|
|
||||||
chart (append
|
|
||||||
(if show-sep?
|
|
||||||
(list (_ "Assets") (_ "Liabilities/Equity")) '())
|
|
||||||
(if show-net?
|
|
||||||
(list (_ "Net Worth")) '())))
|
|
||||||
(gnc:html-barchart-set-col-colors!
|
|
||||||
chart (append
|
|
||||||
(if show-sep?
|
|
||||||
'("blue" "red") '())
|
|
||||||
(if show-net?
|
|
||||||
'("green") '())))
|
|
||||||
|
|
||||||
(if show-sep?
|
|
||||||
(let ((urls
|
|
||||||
(list
|
|
||||||
(gnc:make-report-anchor
|
|
||||||
"Assets Over Time"
|
|
||||||
report-obj
|
|
||||||
(list
|
|
||||||
(list gnc:pagename-display
|
|
||||||
"Use Stacked Bars" #t)
|
|
||||||
(list gnc:pagename-general
|
|
||||||
gnc:optname-reportname
|
|
||||||
(_ "Asset Chart"))))
|
|
||||||
(gnc:make-report-anchor
|
|
||||||
"Liabilities/Equity Over Time"
|
|
||||||
report-obj
|
|
||||||
(list
|
|
||||||
(list gnc:pagename-display
|
|
||||||
"Use Stacked Bars" #t)
|
|
||||||
(list gnc:pagename-general
|
|
||||||
gnc:optname-reportname
|
|
||||||
(_ "Liability/Equity Chart")))))))
|
|
||||||
(gnc:html-barchart-set-button-1-bar-urls!
|
|
||||||
chart urls)
|
|
||||||
(gnc:html-barchart-set-button-1-legend-urls!
|
|
||||||
chart urls)))
|
|
||||||
|
|
||||||
(gnc:html-document-add-object! document chart)
|
|
||||||
|
|
||||||
document))
|
|
||||||
|
|
||||||
;; Here we define the actual report with gnc:define-report
|
|
||||||
(gnc:define-report
|
|
||||||
|
|
||||||
'version 1
|
|
||||||
|
|
||||||
'name (N_ "Net Worth Barchart")
|
|
||||||
|
|
||||||
'menu-path (list gnc:menuname-asset-liability)
|
|
||||||
|
|
||||||
'options-generator options-generator
|
|
||||||
|
|
||||||
'renderer net-worth-series-renderer))
|
|
@ -10,9 +10,7 @@
|
|||||||
(gnc:depend "report/account-summary.scm")
|
(gnc:depend "report/account-summary.scm")
|
||||||
(gnc:depend "report/average-balance.scm")
|
(gnc:depend "report/average-balance.scm")
|
||||||
(gnc:depend "report/balance-sheet.scm")
|
(gnc:depend "report/balance-sheet.scm")
|
||||||
(gnc:depend "report/income-expense-graph.scm")
|
|
||||||
(gnc:depend "report/account-piecharts.scm")
|
(gnc:depend "report/account-piecharts.scm")
|
||||||
(gnc:depend "report/net-worth-timeseries.scm")
|
|
||||||
(gnc:depend "report/category-barchart.scm")
|
(gnc:depend "report/category-barchart.scm")
|
||||||
(gnc:depend "report/pnl.scm")
|
(gnc:depend "report/pnl.scm")
|
||||||
(gnc:depend "report/hello-world.scm")
|
(gnc:depend "report/hello-world.scm")
|
||||||
|
Loading…
Reference in New Issue
Block a user