From 4cb5e2d2664a6798953e305628cb75448280f31b Mon Sep 17 00:00:00 2001 From: Jeremy Brewer Date: Fri, 4 Feb 2011 16:15:43 -0500 Subject: [PATCH] * Altered formatting to use the shorter of floatFormat() or intFormat(). This seems to fix all of the known formatting problems. --- dygraph.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dygraph.js b/dygraph.js index 14b4994..1257b23 100644 --- a/dygraph.js +++ b/dygraph.js @@ -149,7 +149,11 @@ Dygraph.DEFAULT_ATTRS = { labelsKMG2: false, showLabelsOnHighlight: true, - yValueFormatter: Dygraph.floatFormat, + yValueFormatter: function(x, opt_precision) { + var s = Dygraph.floatFormat(x, opt_precision); + var s2 = Dygraph.intFormat(x); + return s.length <= s2.length ? s : s2; + }, strokeWidth: 1.0, -- 2.7.4