Christian Stimming's reporting patch.

* src/scm/report/net-worth-timeseries.scm: Fixed date argument
	bug. Added auto label rotation.

	* src/scm/date-utilities.scm: Renamed gnc:dateloop to
	gnc:make-date-interval-list and gnc:dateloop-simple to
	gnc:make-date-list.

	* src/scm/report/category-barchart.scm, income-expense-graph.scm:
	Adapt to gnc:dateloop's namechange.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3920 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-04-10 07:55:22 +00:00
parent 962ac02652
commit f381ba1a68
6 changed files with 42 additions and 25 deletions

View File

@ -1,3 +1,15 @@
2001-04-10 Christian Stimming <stimming@tuhh.de>
* src/scm/report/net-worth-timeseries.scm: Fixed date argument
bug. Added auto label rotation.
* src/scm/date-utilities.scm: Renamed gnc:dateloop to
gnc:make-date-interval-list and gnc:dateloop-simple to
gnc:make-date-list.
* src/scm/report/category-barchart.scm, income-expense-graph.scm:
Adapt to gnc:dateloop's namechange.
2001-04-10 Robert Graham Merkel <rgmerk@mira.net>
* src/scm/report/net-worth-timeseries.scm: New file. You guessed

View File

@ -200,23 +200,26 @@
;; 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)
(define (gnc:make-date-interval-list curd endd incr)
(cond ((gnc:timepair-later curd endd)
(let ((nextd (incdate curd incr)))
(cond ((gnc:timepair-later nextd endd)
(cons (list curd (decdate nextd SecDelta) '())
(gnc:dateloop nextd endd incr)))
(gnc:make-date-interval-list nextd endd incr)))
(else (cons (list curd endd '()) '())))))
(else '())))
;; Build a list of evenly spaced times. If dates are unevenly spaced,
;; the last interval will be the shorter one/
(define (gnc:dateloop-simple curd endd incr)
(cond ((gnc:timepair-later curd endd)
(let ((nextd (incdate curd incr)))
(cons curd (gnc:dateloop-simple nextd endd incr))))
(else (list endd))))
;; Build a list of times. The dates are evenly spaced with the
;; stepsize 'incr'. If the difference of 'startdate' and 'enddate' is
;; not an integer multiple of 'incr', 'enddate' will be added as the
;; last element of the list, thus making the last interval smaller
;; than 'incr'.
(define (gnc:make-date-list startdate enddate incr)
(cond ((gnc:timepair-later startdate enddate)
(cons startdate
(gnc:make-date-list (incdate startdate incr)
enddate incr)))
(else (list enddate))))
; A reference zero date - the Beginning Of The Epoch

View File

@ -181,7 +181,6 @@
(append (assoc-ref split-up-accounts (_ "Income"))
(assoc-ref split-up-accounts (_ "Expense"))))
;; cstim: happy now? :->
(doc (gnc:make-html-document))
(txt (gnc:make-html-text))

View File

@ -175,7 +175,7 @@
(gnc:get-current-group-depth)
account-levels))
;; This is the list of date intervals to calculate.
(dates-list (gnc:dateloop
(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)))

View File

@ -138,7 +138,7 @@
(exchange-fn-internal (gnc:make-exchange-function exchange-alist))
(exchange-fn (lambda (foreign)
(exchange-fn-internal foreign report-currency)))
(dates-list (gnc:dateloop
(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)))

View File

@ -16,8 +16,8 @@
(optname-report-currency (N_ "Report's currency"))
(pagename-display (N_ "Display"))
(optname-sep-bars (N_ "Show seperate asset & liability/equity bars?"))
(optname-net-bars (N_ "Show net worth bars?"))
(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")))
@ -58,17 +58,17 @@
(add-option
(gnc:make-simple-boolean-option
pagename-display optname-sep-bars
"a" (N_ "Show Seperate Asset and Liability bars?") #t))
"a" (N_ "Show the Asset and the Liability/Equity bars?") #t))
(add-option
(gnc:make-simple-boolean-option
pagename-display optname-net-bars
"b" (N_ "Show A Net Worth bar?") #t))
"b" (N_ "Show a Net Worth bar?") #t))
(gnc:options-add-plot-size!
options pagename-display
optname-plot-width optname-plot-height "c" 400 400)
optname-plot-width optname-plot-height "c" 500 400)
(gnc:options-set-default-section options pagename-general)
@ -140,7 +140,6 @@
(show-sep? (op-value pagename-display optname-sep-bars))
(show-net? (op-value pagename-display optname-net-bars))
; (stacked? (op-value pagename-display optname-stacked))
(height (op-value pagename-display optname-plot-height))
(width (op-value pagename-display optname-plot-width))
@ -151,8 +150,8 @@
(exchange-fn-internal (gnc:make-exchange-function exchange-alist))
(exchange-fn (lambda (foreign)
(exchange-fn-internal foreign report-currency)))
(dates-list (gnc:dateloop-simple
(gnc:timepair-start-day-time from-date-tp)
(dates-list (gnc:make-date-list
(gnc:timepair-end-day-time from-date-tp)
(gnc:timepair-end-day-time to-date-tp)
(eval interval)))
(dummy134 (gnc:debug "dates-list" dates-list))
@ -183,9 +182,13 @@
(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?)
;; 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)
@ -224,7 +227,7 @@
;; The name of this report. This will be used, among other things,
;; for making its menu item in the main menu. You need to use the
;; untranslated value here!
'name (N_ "Net Worth Time Series")
'name (N_ "Net Worth Barchart")
;; The options generator function defined above.
'options-generator options-generator