From: Jeremy Brewer Date: Fri, 4 Feb 2011 21:15:43 +0000 (-0500) Subject: * Altered formatting to use the shorter of floatFormat() or intFormat(). This X-Git-Tag: v1.0.0~588 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=4cb5e2d2664a6798953e305628cb75448280f31b;p=dygraphs.git * Altered formatting to use the shorter of floatFormat() or intFormat(). This seems to fix all of the known formatting problems. --- 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,