X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fy-axis-formatter.html;h=f2fbd001e000265a1d93ebcd23084eb8e24255f1;hb=48e614acf3084b9836803f8b014bf0e65f1ca119;hp=c1c09f91de416fa079e3f0e2ac7570283dd2bde4;hpb=f35016e8b97d39691777a8ad850bfa314e7e223a;p=dygraphs.git diff --git a/tests/y-axis-formatter.html b/tests/y-axis-formatter.html index c1c09f9..f2fbd00 100644 --- a/tests/y-axis-formatter.html +++ b/tests/y-axis-formatter.html @@ -17,7 +17,8 @@

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)

@@ -73,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 + } + } + } } );