gnucash stable: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Sat Jul 5 22:46:26 EDT 2025


Updated	 via  https://github.com/Gnucash/gnucash/commit/ee5ba1cc (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ea1d1716 (commit)
	from  https://github.com/Gnucash/gnucash/commit/368b74c6 (commit)



commit ee5ba1cc9518854092274775c3a29f8c1e8e34b5
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Jul 5 18:34:48 2025 +0800

    [charts] use gnc:html-chart-set-xaxis-type!

diff --git a/gnucash/report/reports/example/sample-graphs.scm b/gnucash/report/reports/example/sample-graphs.scm
index d1df258368..90c7cc160e 100644
--- a/gnucash/report/reports/example/sample-graphs.scm
+++ b/gnucash/report/reports/example/sample-graphs.scm
@@ -112,7 +112,7 @@
     ;; also illustrates how to precisely select chartjs options. The
     ;; second parameter is a list of symbols to target a particular
     ;; chartJS option. See chartJS documentation.
-    (gnc:html-chart-set! chart '(options scales xAxes (0) type) "linear")
+    (gnc:html-chart-set-x-axis-type! chart 'linear)
 
     chart))
 
diff --git a/gnucash/report/reports/standard/price-scatter.scm b/gnucash/report/reports/standard/price-scatter.scm
index 4c14c69e6b..6d83e16686 100644
--- a/gnucash/report/reports/standard/price-scatter.scm
+++ b/gnucash/report/reports/standard/price-scatter.scm
@@ -202,8 +202,7 @@
      chart (gnc-commodity-get-mnemonic amount-commodity))
 
     (gnc:html-chart-set-x-axis-label! chart int-label)
-
-    (gnc:html-chart-set! chart '(options scales xAxes (0) type) 'linear)
+    (gnc:html-chart-set-x-axis-type! chart 'linear)
     (gnc:html-chart-set-custom-x-axis-ticks?! chart #f)
 
     (cond

commit ea1d1716a810bc6a7e3723deb2bb7c4872d425ca
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Jul 5 18:34:37 2025 +0800

    [html-chart] expose gnc:html-chart-set-x-axis-type!
    
    Centralise to ease chartjs upgrade. The option path changes as
    follows:
    
    '(options scales xAxes (0) type) in chartjs-2
    '(options scales x type) in chartjs-3

diff --git a/gnucash/report/html-chart.scm b/gnucash/report/html-chart.scm
index 825f95efbe..081b076d5d 100644
--- a/gnucash/report/html-chart.scm
+++ b/gnucash/report/html-chart.scm
@@ -61,6 +61,7 @@
 (export gnc:html-chart-set-axes-display!)
 (export gnc:html-chart-set-custom-y-axis-ticks?!)
 (export gnc:html-chart-clear-data-series!)
+(export gnc:html-chart-set-x-axis-type!)
 (export gnc:html-chart-set-x-axis-label!)
 (export gnc:html-chart-set-stacking?!)
 (export gnc:html-chart-set-grid?!)
@@ -286,6 +287,9 @@
   (gnc:html-chart-set! chart '(options scales xAxes (0) display) display?)
   (gnc:html-chart-set! chart '(options scales yAxes (0) display) display?))
 
+(define (gnc:html-chart-set-x-axis-type! chart type)
+  (gnc:html-chart-set! chart '(options scales xAxes (0) type) type))
+
 ;; e.g.:
 ;; (gnc:html-chart-add-data-series! chart "label" list-of-numbers color
 ;;  'fill #t



Summary of changes:
 gnucash/report/html-chart.scm                     | 4 ++++
 gnucash/report/reports/example/sample-graphs.scm  | 2 +-
 gnucash/report/reports/standard/price-scatter.scm | 3 +--
 3 files changed, 6 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list