Christian Stimming's report patch.

* src/scm/report/report-list.scm, Makefile.am: Added new file.

	* src/scm/report/category-barchart.scm: Two new reports. Shows
	barchart of income (or expense) categories over time.

	* src/scm/report/income-expense-graph.scm: Use more
	option-utilities.scm. Fixed gnc:dateloop usage (last interval was
	wrong).

	* src/scm/html-barchart.scm: Added record components for bar- and
	legend-urls and their accessor/modifier functions. FIXME: They
	don't get rendered yet -- somebody has to add that.

	* src/scm/date-utilities.scm (gnc:dateloop): Fixed last interval
	not to be longer than the specified end date.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3855 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-03-29 11:03:02 +00:00
parent ab045ac3f6
commit 2310042ef6
8 changed files with 87 additions and 27 deletions

View File

@ -1,3 +1,21 @@
2001-03-29 Christian Stimming <stimming@tuhh.de>
* src/scm/report/report-list.scm, Makefile.am: Added new file.
* src/scm/report/category-barchart.scm: Two new reports. Shows
barchart of income (or expense) categories over time.
* src/scm/report/income-expense-graph.scm: Use more
option-utilities.scm. Fixed gnc:dateloop usage (last interval was
wrong).
* src/scm/html-barchart.scm: Added record components for bar- and
legend-urls and their accessor/modifier functions. FIXME: They
don't get rendered yet -- somebody has to add that.
* src/scm/date-utilities.scm (gnc:dateloop): Fixed last interval
not to be longer than the specified end date.
2001-03-29 James LewisMoss <jimdres@mindspring.com>
* src/engine/io-gncxml-v2.c (write_counts): don't add an amount if

View File

@ -195,12 +195,18 @@
(gnc:timepair-eq (gnc:timepair-canonical-day-time t1)
(gnc:timepair-canonical-day-time t2)))
;; Build a list of time intervals
;; Build a list of time intervals.
;;
;; Note that the last interval will be shorter than <incr> if
;; (<curd>-<endd>) is not an integer multiple of <incr>. If you don't
;; want that you'll have to write another function.
(define (gnc:dateloop curd endd incr)
(cond ((gnc:timepair-later curd endd)
(let ((nextd (incdate curd incr)))
(cons (list curd (decdate nextd SecDelta) '())
(gnc:dateloop nextd endd incr))))
(cond ((gnc:timepair-later nextd endd)
(cons (list curd (decdate nextd SecDelta) '())
(gnc:dateloop nextd endd incr)))
(else (cons (list curd endd '()) '())))))
(else '())))
; A reference zero date - the Beginning Of The Epoch

View File

@ -36,7 +36,11 @@
col-colors
row-labels-rotated?
stacked?
data)))
data
button-1-bar-urls button-2-bar-urls
button-3-bar-urls
button-1-legend-urls button-2-legend-urls
button-3-legend-urls)))
(define gnc:html-barchart?
(record-predicate <html-barchart>))
@ -50,7 +54,8 @@
(record-constructor <html-barchart>))
(define (gnc:make-html-barchart)
(gnc:make-html-barchart-internal -1 -1 #f #f #f #f '() '() '() #f #f '()))
(gnc:make-html-barchart-internal -1 -1 #f #f #f #f '() '() '()
#f #f '() #f #f #f #f #f #f))
(define gnc:html-barchart-data
(record-accessor <html-barchart> 'data))
@ -124,6 +129,42 @@
(define gnc:html-barchart-set-subtitle!
(record-modifier <html-barchart> 'subtitle))
(define gnc:html-barchart-button-1-bar-urls
(record-accessor <html-barchart> 'button-1-bar-urls))
(define gnc:html-barchart-set-button-1-bar-urls!
(record-modifier <html-barchart> 'button-1-bar-urls))
(define gnc:html-barchart-button-2-bar-urls
(record-accessor <html-barchart> 'button-2-bar-urls))
(define gnc:html-barchart-set-button-2-bar-urls!
(record-modifier <html-barchart> 'button-2-bar-urls))
(define gnc:html-barchart-button-3-bar-urls
(record-accessor <html-barchart> 'button-3-bar-urls))
(define gnc:html-barchart-set-button-3-bar-urls!
(record-modifier <html-barchart> 'button-3-bar-urls))
(define gnc:html-barchart-button-1-legend-urls
(record-accessor <html-barchart> 'button-1-legend-urls))
(define gnc:html-barchart-set-button-1-legend-urls!
(record-modifier <html-barchart> 'button-1-legend-urls))
(define gnc:html-barchart-button-2-legend-urls
(record-accessor <html-barchart> 'button-2-legend-urls))
(define gnc:html-barchart-set-button-2-legend-urls!
(record-modifier <html-barchart> 'button-2-legend-urls))
(define gnc:html-barchart-button-3-legend-urls
(record-accessor <html-barchart> 'button-3-legend-urls))
(define gnc:html-barchart-set-button-3-legend-urls!
(record-modifier <html-barchart> 'button-3-legend-urls))
(define (gnc:html-barchart-append-row! barchart newrow)
(let ((dd (gnc:html-barchart-data barchart)))
(set! dd (append dd (list newrow)))

View File

@ -71,12 +71,12 @@
;; A date interval multichoice option.
(define (gnc:options-add-interval-choice!
options pagename optname sort-tag)
options pagename optname sort-tag default)
(gnc:register-option
options
(gnc:make-multichoice-option
pagename optname
sort-tag (_ "The amount of time between data points") 'WeekDelta
sort-tag (_ "The amount of time between data points") default
(list (vector 'DayDelta (_ "Day") (_ "Day"))
(vector 'WeekDelta (_ "Week") (_ "Week"))
(vector 'TwoWeekDelta (_ "2Week") (_ "Two Week"))

View File

@ -4,20 +4,21 @@ gncscmdir = ${GNC_SCM_INSTALL_DIR}/report
gncscm_DATA = \
account-summary.scm \
average-balance.scm \
pnl.scm \
category-barchart.scm \
hello-world.scm \
income-expense-graph.scm \
income-or-expense-pie.scm \
hello-world.scm \
pnl.scm \
portfolio.scm \
register.scm \
report-list.scm \
stylesheet-plain.scm \
stylesheet-fancy.scm \
stylesheet-plain.scm \
table-test.scm \
taxtxf.scm \
txf-export.scm \
txf-export-help.scm \
transaction-report.scm \
txf-export-help.scm \
txf-export.scm \
view-column.scm
EXTRA_DIST = \

View File

@ -52,7 +52,7 @@
#f #t))
(gnc:options-add-interval-choice!
options pagename-general (N_ "Step Size") "b")
options pagename-general (N_ "Step Size") "b" 'TwoWeekDelta)
(register-option
(gnc:make-simple-boolean-option

View File

@ -35,7 +35,7 @@
optname-from-date optname-to-date "a")
(gnc:options-add-interval-choice!
options pagename-general optname-stepsize "b")
options pagename-general optname-stepsize "b" 'MonthDelta)
(add-option
(gnc:make-account-list-option
@ -51,14 +51,8 @@
(filter gnc:account-is-inc-exp? accounts)))
#t))
(add-option
(gnc:make-currency-option
pagename-general optname-report-currency
"d"
(_ "Select the display value for the currency")
(gnc:option-value
(gnc:lookup-global-option "International"
"Default Currency"))))
(gnc:options-add-currency!
options pagename-general optname-report-currency "d")
(add-option
(gnc:make-simple-boolean-option
@ -75,8 +69,9 @@
pagename-display optname-stacked
"ba" (_ "Show barchart as stacked?") #f))
(gnc:options-add-plot-size! options pagename-display
optname-plot-width optname-plot-height "c" 400 400)
(gnc:options-add-plot-size!
options pagename-display
optname-plot-width optname-plot-height "c" 400 400)
(gnc:options-set-default-section options pagename-general)
@ -144,10 +139,8 @@
(exchange-fn (lambda (foreign)
(exchange-fn-internal foreign report-currency)))
(dates-list (gnc:dateloop
;; FIXME: gnc:dateloop is toast (see ML)
(gnc:timepair-start-day-time from-date-tp)
(gnc:timepair-end-day-time
(decdate to-date-tp DayDelta))
(gnc:timepair-end-day-time to-date-tp)
(eval interval)))
(income-collector-fn (collector-fn accounts #t))
(expense-collector-fn (collector-fn accounts #f))

View File

@ -10,6 +10,7 @@
(gnc:depend "report/average-balance.scm")
(gnc:depend "report/income-expense-graph.scm")
(gnc:depend "report/income-or-expense-pie.scm")
(gnc:depend "report/category-barchart.scm")
(gnc:depend "report/pnl.scm")
(gnc:depend "report/hello-world.scm")
(gnc:depend "report/portfolio.scm")