mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Christian Stimming's report patch.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3841 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
2d76753469
commit
eb30788e02
@ -507,6 +507,8 @@ gnc_html_embedded_barchart(gnc_html * parent,
|
|||||||
int datarows=0;
|
int datarows=0;
|
||||||
int datacols=0;
|
int datacols=0;
|
||||||
int rotate=0;
|
int rotate=0;
|
||||||
|
int stacked=0;
|
||||||
|
int normalize_stacks=0;
|
||||||
double * data=NULL;
|
double * data=NULL;
|
||||||
char ** col_labels=NULL;
|
char ** col_labels=NULL;
|
||||||
char ** row_labels=NULL;
|
char ** row_labels=NULL;
|
||||||
@ -579,6 +581,20 @@ gnc_html_embedded_barchart(gnc_html * parent,
|
|||||||
GTK_VALUE_BOOL(arglist[argind]) = rotate;
|
GTK_VALUE_BOOL(arglist[argind]) = rotate;
|
||||||
argind++;
|
argind++;
|
||||||
}
|
}
|
||||||
|
if((param = g_hash_table_lookup(params, "stacked")) != NULL) {
|
||||||
|
sscanf(param, "%d", &stacked);
|
||||||
|
arglist[argind].name = "stacked";
|
||||||
|
arglist[argind].type = GTK_TYPE_BOOL;
|
||||||
|
GTK_VALUE_BOOL(arglist[argind]) = stacked;
|
||||||
|
argind++;
|
||||||
|
}
|
||||||
|
if((param = g_hash_table_lookup(params, "normalize_stacks")) != NULL) {
|
||||||
|
sscanf(param, "%d", &normalize_stacks);
|
||||||
|
arglist[argind].name = "normalize_stacks";
|
||||||
|
arglist[argind].type = GTK_TYPE_BOOL;
|
||||||
|
GTK_VALUE_BOOL(arglist[argind]) = normalize_stacks;
|
||||||
|
argind++;
|
||||||
|
}
|
||||||
if((param = g_hash_table_lookup(params, "bar_urls_1")) != NULL) {
|
if((param = g_hash_table_lookup(params, "bar_urls_1")) != NULL) {
|
||||||
arglist[argind].name = "bar_callback1";
|
arglist[argind].name = "bar_callback1";
|
||||||
arglist[argind].type = GTK_TYPE_POINTER;
|
arglist[argind].type = GTK_TYPE_POINTER;
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
row-labels
|
row-labels
|
||||||
col-colors
|
col-colors
|
||||||
row-labels-rotated?
|
row-labels-rotated?
|
||||||
|
stacked?
|
||||||
data)))
|
data)))
|
||||||
|
|
||||||
(define gnc:html-barchart?
|
(define gnc:html-barchart?
|
||||||
@ -49,7 +50,7 @@
|
|||||||
(record-constructor <html-barchart>))
|
(record-constructor <html-barchart>))
|
||||||
|
|
||||||
(define (gnc:make-html-barchart)
|
(define (gnc:make-html-barchart)
|
||||||
(gnc:make-html-barchart-internal -1 -1 #f #f #f #f '() '() '() #f '()))
|
(gnc:make-html-barchart-internal -1 -1 #f #f #f #f '() '() '() #f #f '()))
|
||||||
|
|
||||||
(define gnc:html-barchart-data
|
(define gnc:html-barchart-data
|
||||||
(record-accessor <html-barchart> 'data))
|
(record-accessor <html-barchart> 'data))
|
||||||
@ -93,6 +94,12 @@
|
|||||||
(define gnc:html-barchart-set-row-labels-rotated?!
|
(define gnc:html-barchart-set-row-labels-rotated?!
|
||||||
(record-modifier <html-barchart> 'row-labels-rotated?))
|
(record-modifier <html-barchart> 'row-labels-rotated?))
|
||||||
|
|
||||||
|
(define gnc:html-barchart-stacked?
|
||||||
|
(record-accessor <html-barchart> 'stacked?))
|
||||||
|
|
||||||
|
(define gnc:html-barchart-set-stacked?!
|
||||||
|
(record-modifier <html-barchart> 'stacked?))
|
||||||
|
|
||||||
(define gnc:html-barchart-col-labels
|
(define gnc:html-barchart-col-labels
|
||||||
(record-accessor <html-barchart> 'col-labels))
|
(record-accessor <html-barchart> 'col-labels))
|
||||||
|
|
||||||
@ -306,6 +313,8 @@
|
|||||||
(if rot?
|
(if rot?
|
||||||
(push "1\">\n")
|
(push "1\">\n")
|
||||||
(push "0\">\n")))
|
(push "0\">\n")))
|
||||||
|
(if (gnc:html-barchart-stacked? barchart)
|
||||||
|
(push " <param name=\"stacked\" value=\"1\">\n"))
|
||||||
(push "Unable to push bar chart\n")
|
(push "Unable to push bar chart\n")
|
||||||
(push "</object>"))
|
(push "</object>"))
|
||||||
" ")
|
" ")
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
(pagename-display (N_ "Display"))
|
(pagename-display (N_ "Display"))
|
||||||
(optname-inc-exp (N_ "Show Income/Expense"))
|
(optname-inc-exp (N_ "Show Income/Expense"))
|
||||||
(optname-show-profit (N_ "Show Net Profit"))
|
(optname-show-profit (N_ "Show Net Profit"))
|
||||||
|
(optname-stacked (N_ "Stacked"))
|
||||||
(optname-plot-width (N_ "Plot Width"))
|
(optname-plot-width (N_ "Plot Width"))
|
||||||
(optname-plot-height (N_ "Plot Height")))
|
(optname-plot-height (N_ "Plot Height")))
|
||||||
|
|
||||||
@ -77,6 +78,11 @@
|
|||||||
pagename-display optname-show-profit
|
pagename-display optname-show-profit
|
||||||
"b" (_ "Show the net profit?") #f))
|
"b" (_ "Show the net profit?") #f))
|
||||||
|
|
||||||
|
(add-option
|
||||||
|
(gnc:make-simple-boolean-option
|
||||||
|
pagename-display optname-stacked
|
||||||
|
"ba" (_ "Show barchart as stacked?") #t))
|
||||||
|
|
||||||
(add-option
|
(add-option
|
||||||
(gnc:make-number-range-option
|
(gnc:make-number-range-option
|
||||||
pagename-display optname-plot-width
|
pagename-display optname-plot-width
|
||||||
@ -143,6 +149,7 @@
|
|||||||
|
|
||||||
(show-net? (op-value pagename-display optname-show-profit))
|
(show-net? (op-value pagename-display optname-show-profit))
|
||||||
(show-incexp? (op-value pagename-display optname-inc-exp))
|
(show-incexp? (op-value pagename-display optname-inc-exp))
|
||||||
|
(stacked? (op-value pagename-display optname-stacked))
|
||||||
(height (op-value pagename-display optname-plot-height))
|
(height (op-value pagename-display optname-plot-height))
|
||||||
(width (op-value pagename-display optname-plot-width))
|
(width (op-value pagename-display optname-plot-width))
|
||||||
|
|
||||||
@ -187,6 +194,7 @@
|
|||||||
(gnc:html-barchart-set-y-axis-label!
|
(gnc:html-barchart-set-y-axis-label!
|
||||||
chart (gnc:commodity-get-mnemonic report-currency))
|
chart (gnc:commodity-get-mnemonic report-currency))
|
||||||
(gnc:html-barchart-set-row-labels-rotated?! chart #t)
|
(gnc:html-barchart-set-row-labels-rotated?! chart #t)
|
||||||
|
(gnc:html-barchart-set-stacked?! chart stacked?)
|
||||||
|
|
||||||
(if show-incexp?
|
(if show-incexp?
|
||||||
(begin
|
(begin
|
||||||
|
Loading…
Reference in New Issue
Block a user