X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fy-axis-formatter.html;h=f2fbd001e000265a1d93ebcd23084eb8e24255f1;hb=c1f22b5a5d4ffbf25a75fc567232e65381c1938b;hp=0316bc251239860a6d35e5c91e5874817c567dab;hpb=54425b14df388e9337a1d77876512bb60ba74c3b;p=dygraphs.git diff --git a/tests/y-axis-formatter.html b/tests/y-axis-formatter.html index 0316bc2..f2fbd00 100644 --- a/tests/y-axis-formatter.html +++ b/tests/y-axis-formatter.html @@ -1,20 +1,24 @@ + dygraph - - - - + + +

Potential Y Axis formatting problems for small values

-

The problem using default y axis formatting for very small values:

+

The problem using default y axis formatting for very small values:
+ (this was more of a problem before dygraphs automatically switched to scientific notation)

@@ -70,15 +78,19 @@ ], { stepPlot: true, - yValueFormatter: function(x) { - var shift = Math.pow(10, 5) - return "*" + Math.round(x * shift) / shift - }, - yAxisLabelFormatter: function(x) { - var shift = Math.pow(10, 5) - return "+" + Math.round(x * shift) / shift - }, - labels: ["X", "Data"] + labels: ["X", "Data"], + axes: { + y: { + valueFormatter: function(x) { + var shift = Math.pow(10, 5) + return "*" + Math.round(x * shift) / shift + }, + axisLabelFormatter: function(x) { + var shift = Math.pow(10, 5) + return "+" + Math.round(x * shift) / shift + } + } + } } );