|
|
|
|
@ -141,7 +141,7 @@
|
|
|
|
|
;; AND:
|
|
|
|
|
;; To ensure that the generated subtitle doesn't contain any
|
|
|
|
|
;; unescaped quotes or backslashes, all strings must be freed
|
|
|
|
|
;; from those by calling jqplot-escape-string.
|
|
|
|
|
;; from those by calling gnc:html-string-sanitize.
|
|
|
|
|
;; Otherwise we're opening the gates again for bug 721768.
|
|
|
|
|
;;
|
|
|
|
|
;; Example: "\n" must be translated to "<br /> to introduce
|
|
|
|
|
@ -150,9 +150,9 @@
|
|
|
|
|
;; Example call:
|
|
|
|
|
;; (gnc:html-barchart-set-subtitle! chart
|
|
|
|
|
;; (string-append "Bgt:"
|
|
|
|
|
;; (jqplot-escape-string (number->string bgt-sum))
|
|
|
|
|
;; (gnc:html-string-sanitize (number->string bgt-sum))
|
|
|
|
|
;; "<br /> Act:" ;; line break in the chart sub-title
|
|
|
|
|
;; (jqplot-escape-string (number->string act-sum))))
|
|
|
|
|
;; (gnc:html-string-sanitize (number->string act-sum))))
|
|
|
|
|
(define gnc:html-barchart-set-subtitle!
|
|
|
|
|
(record-modifier <html-barchart> 'subtitle))
|
|
|
|
|
|
|
|
|
|
@ -372,9 +372,9 @@
|
|
|
|
|
(push "data.push(d")
|
|
|
|
|
(push series-index)
|
|
|
|
|
(push ");\n")
|
|
|
|
|
(push "series.push({ label: \"")
|
|
|
|
|
(push (jqplot-escape-string label))
|
|
|
|
|
(push "\"});\n\n")))
|
|
|
|
|
(push (format #f "series.push({ label: ~s });\n\n"
|
|
|
|
|
(gnc:html-string-sanitize label)))
|
|
|
|
|
))
|
|
|
|
|
; Use a unique chart-id for each chart. This prevents chart
|
|
|
|
|
; clashed on multi-column reports
|
|
|
|
|
(chart-id (string-append "chart-" (number->string (random 999999)))))
|
|
|
|
|
@ -485,16 +485,13 @@
|
|
|
|
|
"false;\n"))
|
|
|
|
|
|
|
|
|
|
(if title
|
|
|
|
|
(begin
|
|
|
|
|
(push " options.title = \"")
|
|
|
|
|
(push (jqplot-escape-string title))
|
|
|
|
|
(push "\";\n")))
|
|
|
|
|
(push (format #f " options.title = ~s;\n"
|
|
|
|
|
(gnc:html-string-sanitize title))))
|
|
|
|
|
|
|
|
|
|
(if subtitle
|
|
|
|
|
(begin
|
|
|
|
|
(push " options.title += \" <br />")
|
|
|
|
|
(push subtitle)
|
|
|
|
|
(push "\";\n")))
|
|
|
|
|
(push (format #f " options.title += ' <br />' + ~s;\n"
|
|
|
|
|
(gnc:html-string-sanitize subtitle))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(if (and (string? x-label) (> (string-length x-label) 0))
|
|
|
|
|
(begin
|
|
|
|
|
|