From 88bfbb19a043949ca406d52036578ece27611ca4 Mon Sep 17 00:00:00 2001 From: Carsten Rinke Date: Sun, 1 Jun 2014 13:44:51 +0200 Subject: [PATCH] Bug 720934 - Barcharts with many data points have overlapping x-axis labels Use jqplot.cursor.js (enanbles zooming) and jqplot.dateAxisRenderer.js instead of jqplot.categoryAxisRenderer.js --- src/report/report-system/html-barchart.scm | 30 ++++++++++------------ 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/report/report-system/html-barchart.scm b/src/report/report-system/html-barchart.scm index f751e6ade0..dd4ab19906 100644 --- a/src/report/report-system/html-barchart.scm +++ b/src/report/report-system/html-barchart.scm @@ -359,12 +359,12 @@ (push "var d") (push series-index) (push " = [];\n"))) - (series-data-add (lambda (series-index x y) + (series-data-add (lambda (series-index date y) (push (string-append " d" (number->string series-index) ".push([" - (number->string x) + "\"" date "\"" ", " (number->string y) "]);\n")))) @@ -385,10 +385,12 @@ (push (gnc:html-js-include "jqplot/jquery.min.js")) (push (gnc:html-js-include "jqplot/jquery.jqplot.js")) (push (gnc:html-js-include "jqplot/jqplot.barRenderer.js")) - (push (gnc:html-js-include "jqplot/jqplot.categoryAxisRenderer.js")) + (push (gnc:html-js-include "jqplot/jqplot.cursor.js")) + (push (gnc:html-js-include "jqplot/jqplot.dateAxisRenderer.js")) (push (gnc:html-js-include "jqplot/jqplot.highlighter.js")) (push (gnc:html-js-include "jqplot/jqplot.canvasTextRenderer.js")) (push (gnc:html-js-include "jqplot/jqplot.canvasAxisTickRenderer.js")) + (push (gnc:html-css-include "jqplot/jquery.jqplot.css")) (push "
(string-length row-labels) 0)) - (begin - (push " options.axes.xaxis.ticks = [") - (for-each (lambda (val) - (push "\"") - (push val) - (push "\",")) - (gnc:html-barchart-row-labels barchart)) - (push "];\n"))) (push "$.jqplot.config.enablePlugins = true;")