mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge branch 'maint-797893' into maint #789
This commit is contained in:
commit
6ecbb814e0
@ -186,7 +186,6 @@
|
|||||||
(cons 'display #t)
|
(cons 'display #t)
|
||||||
(cons 'labelString "")))
|
(cons 'labelString "")))
|
||||||
(cons 'ticks (list
|
(cons 'ticks (list
|
||||||
(cons 'fontSize 12)
|
|
||||||
(cons 'maxRotation 30))))
|
(cons 'maxRotation 30))))
|
||||||
;; the following another xAxis at the top
|
;; the following another xAxis at the top
|
||||||
'((position . top)
|
'((position . top)
|
||||||
@ -205,7 +204,6 @@
|
|||||||
(cons 'display 1.5)
|
(cons 'display 1.5)
|
||||||
(cons 'labelString "")))
|
(cons 'labelString "")))
|
||||||
(cons 'ticks (list
|
(cons 'ticks (list
|
||||||
(cons 'fontSize 10)
|
|
||||||
(cons 'beginAtZero #f))))
|
(cons 'beginAtZero #f))))
|
||||||
;; the following another yAxis on the right
|
;; the following another yAxis on the right
|
||||||
'((position . right)
|
'((position . right)
|
||||||
@ -215,7 +213,6 @@
|
|||||||
))))
|
))))
|
||||||
(cons 'title (list
|
(cons 'title (list
|
||||||
(cons 'display #t)
|
(cons 'display #t)
|
||||||
(cons 'fontSize 16)
|
|
||||||
(cons 'fontStyle "")
|
(cons 'fontStyle "")
|
||||||
(cons 'text ""))))))
|
(cons 'text ""))))))
|
||||||
"XXX" ;currency-iso
|
"XXX" ;currency-iso
|
||||||
@ -348,6 +345,17 @@ Chart.pluginService.register({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// copy font info from css into chartjs.
|
||||||
|
bodyStyle = window.getComputedStyle (document.querySelector ('body'));
|
||||||
|
Chart.defaults.global.defaultFontSize = parseInt (bodyStyle.fontSize);
|
||||||
|
Chart.defaults.global.defaultFontFamily = bodyStyle.fontFamily;
|
||||||
|
Chart.defaults.global.defaultFontStyle = bodyStyle.fontStyle;
|
||||||
|
|
||||||
|
titleStyle = window.getComputedStyle (document.querySelector ('h3'));
|
||||||
|
chartjsoptions.options.title.fontSize = parseInt (titleStyle.fontSize);
|
||||||
|
chartjsoptions.options.title.fontFamily = titleStyle.fontFamily;
|
||||||
|
chartjsoptions.options.title.fontStyle = titleStyle.fontStyle;
|
||||||
|
|
||||||
document.getElementById(chartid).onclick = function(evt) {
|
document.getElementById(chartid).onclick = function(evt) {
|
||||||
var activepoints = myChart.getElementAtEvent(evt);
|
var activepoints = myChart.getElementAtEvent(evt);
|
||||||
var anchor = document.getElementById(jumpid);
|
var anchor = document.getElementById(jumpid);
|
||||||
@ -398,21 +406,23 @@ document.getElementById(chartid).onclick = function(evt) {
|
|||||||
(push (lambda (l) (set! retval (cons l retval))))
|
(push (lambda (l) (set! retval (cons l retval))))
|
||||||
;; Use a unique chart-id for each chart. This prevents charts
|
;; Use a unique chart-id for each chart. This prevents charts
|
||||||
;; clashing on multi-column reports
|
;; clashing on multi-column reports
|
||||||
(id (guid-new-return)))
|
(id (symbol->string (gensym "chart"))))
|
||||||
|
|
||||||
(push (gnc:html-js-include
|
(push (gnc:html-js-include
|
||||||
(gnc-path-find-localized-html-file "chartjs/Chart.bundle.min.js")))
|
(gnc-path-find-localized-html-file "chartjs/Chart.bundle.min.js")))
|
||||||
|
|
||||||
|
;; the following hidden h3 is used to query style and copy onto chartjs
|
||||||
|
(push "<h3 style='display:none'></h3>")
|
||||||
(push (format #f "<div style='width:~a;height:~a;'>\n"
|
(push (format #f "<div style='width:~a;height:~a;'>\n"
|
||||||
(size->str (gnc:html-chart-width chart))
|
(size->str (gnc:html-chart-width chart))
|
||||||
(size->str (gnc:html-chart-height chart))))
|
(size->str (gnc:html-chart-height chart))))
|
||||||
(push (format #f "<a id='jump-~a' href='' style='display:none'></a>\n" id))
|
(push (format #f "<a id='jump-~a' href='' style='display:none'></a>\n" id))
|
||||||
(push (format #f "<canvas id='chart-~a'></canvas>\n" id))
|
(push (format #f "<canvas id=~s></canvas>\n" id))
|
||||||
(push "</div>\n")
|
(push "</div>\n")
|
||||||
(push (format #f "<script id='script-~a'>\n" id))
|
(push (format #f "<script id='script-~a'>\n" id))
|
||||||
(push (format #f "var curriso = ~s;\n" (gnc:html-chart-currency-iso chart)))
|
(push (format #f "var curriso = ~s;\n" (gnc:html-chart-currency-iso chart)))
|
||||||
(push (format #f "var currsym = ~s;\n" (gnc:html-chart-currency-symbol chart)))
|
(push (format #f "var currsym = ~s;\n" (gnc:html-chart-currency-symbol chart)))
|
||||||
(push (format #f "var chartid = 'chart-~a';\n" id))
|
(push (format #f "var chartid = ~s;\n" id))
|
||||||
(push (format #f "var jumpid = 'jump-~a';\n" id))
|
(push (format #f "var jumpid = 'jump-~a';\n" id))
|
||||||
(push (format #f "var loadstring = ~s;\n" (G_ "Load")))
|
(push (format #f "var loadstring = ~s;\n" (G_ "Load")))
|
||||||
(push (format #f "var chartjsoptions = ~a;\n\n"
|
(push (format #f "var chartjsoptions = ~a;\n\n"
|
||||||
@ -428,7 +438,6 @@ document.getElementById(chartid).onclick = function(evt) {
|
|||||||
|
|
||||||
(push "chartjsoptions.options.tooltips.callbacks.label = tooltipLabel;\n")
|
(push "chartjsoptions.options.tooltips.callbacks.label = tooltipLabel;\n")
|
||||||
(push "chartjsoptions.options.tooltips.callbacks.title = tooltipTitle;\n")
|
(push "chartjsoptions.options.tooltips.callbacks.title = tooltipTitle;\n")
|
||||||
(push "Chart.defaults.global.defaultFontFamily = \"'Trebuchet MS', Arial, Helvetica, sans-serif\";\n")
|
|
||||||
(push JS-setup)
|
(push JS-setup)
|
||||||
|
|
||||||
(push "var myChart = new Chart(chartid, chartjsoptions);\n")
|
(push "var myChart = new Chart(chartid, chartjsoptions);\n")
|
||||||
|
@ -228,13 +228,10 @@
|
|||||||
|
|
||||||
|
|
||||||
(define (gnc:html-make-generic-simple-warning report-title-string message)
|
(define (gnc:html-make-generic-simple-warning report-title-string message)
|
||||||
(let ((p (gnc:make-html-text)))
|
(gnc:make-html-text
|
||||||
(gnc:html-text-append!
|
(gnc:html-markup-h3 (string-append report-title-string ":"))
|
||||||
p
|
(gnc:html-markup-h3 "")
|
||||||
(gnc:html-markup-h2 (string-append report-title-string ":"))
|
(gnc:html-markup-p message)))
|
||||||
(gnc:html-markup-h2 "")
|
|
||||||
(gnc:html-markup-p message))
|
|
||||||
p))
|
|
||||||
|
|
||||||
|
|
||||||
(define (gnc:html-make-options-link report-id)
|
(define (gnc:html-make-options-link report-id)
|
||||||
@ -301,14 +298,11 @@
|
|||||||
(define (gnc:html-make-generic-warning
|
(define (gnc:html-make-generic-warning
|
||||||
report-title-string report-id
|
report-title-string report-id
|
||||||
warning-title-string warning-string)
|
warning-title-string warning-string)
|
||||||
(let ((p (gnc:make-html-text)))
|
(gnc:make-html-text
|
||||||
(gnc:html-text-append!
|
(gnc:html-markup-h3 (string-append (G_ report-title-string) ":"))
|
||||||
p
|
(gnc:html-markup-h3 warning-title-string)
|
||||||
(gnc:html-markup-h2 (string-append (G_ report-title-string) ":"))
|
(gnc:html-markup-p warning-string)
|
||||||
(gnc:html-markup-h2 warning-title-string)
|
(gnc:html-make-options-link report-id)))
|
||||||
(gnc:html-markup-p warning-string)
|
|
||||||
(gnc:html-make-options-link report-id))
|
|
||||||
p))
|
|
||||||
|
|
||||||
(define (gnc:html-make-generic-options-warning
|
(define (gnc:html-make-generic-options-warning
|
||||||
report-title-string report-id)
|
report-title-string report-id)
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
(gnc:html-document-add-object!
|
(gnc:html-document-add-object!
|
||||||
doc
|
doc
|
||||||
(gnc:make-html-text
|
(gnc:make-html-text
|
||||||
(gnc:html-markup-h2
|
(gnc:html-markup-h3
|
||||||
(format #f (G_ "Welcome to GnuCash ~a !")
|
(format #f (G_ "Welcome to GnuCash ~a !")
|
||||||
gnc:version))
|
gnc:version))
|
||||||
(gnc:html-markup-p
|
(gnc:html-markup-p
|
||||||
|
@ -1079,7 +1079,7 @@ invoices and amounts.")))))
|
|||||||
(gnc:html-document-add-object!
|
(gnc:html-document-add-object!
|
||||||
document
|
document
|
||||||
(gnc:make-html-text
|
(gnc:make-html-text
|
||||||
(gnc:html-markup-h2 (G_ "No transactions found."))
|
(gnc:html-markup-h3 (G_ "No transactions found."))
|
||||||
(gnc:html-markup-p (G_ "No matching transactions found"))
|
(gnc:html-markup-p (G_ "No matching transactions found"))
|
||||||
(gnc:html-make-options-link (gnc:report-id report-obj)))))
|
(gnc:html-make-options-link (gnc:report-id report-obj)))))
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@
|
|||||||
(gnc:html-document-add-object!
|
(gnc:html-document-add-object!
|
||||||
document
|
document
|
||||||
(gnc:make-html-text
|
(gnc:make-html-text
|
||||||
(gnc:html-markup-h2 title)
|
(gnc:html-markup-h3 title)
|
||||||
(gnc:html-markup-p text))))
|
(gnc:html-markup-p text))))
|
||||||
|
|
||||||
(gnc:html-chart-set-type! chart 'line)
|
(gnc:html-chart-set-type! chart 'line)
|
||||||
|
Loading…
Reference in New Issue
Block a user