X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2FlabelsKMB.html;h=3b441600e296b3039596d34150d0c637f02a90ee;hb=7c45116b8b3d8a3b5cceff1e1fb40e0749571df5;hp=0093b06a6258aef2ca4d527ce354cbad2699b9fa;hpb=bff6800b2885c168f3c276b50fa73b7679824067;p=dygraphs.git diff --git a/tests/labelsKMB.html b/tests/labelsKMB.html index 0093b06..3b44160 100644 --- a/tests/labelsKMB.html +++ b/tests/labelsKMB.html @@ -1,16 +1,12 @@ - labelsKMB - - + @@ -23,6 +19,9 @@

labelsKMG2 with yValueFormatter:

+

labelsKMG2 with very small numbers:

+
+

The curves are exponentials. Zooming in should reveal each of the 'K', 'M', 'B', etc. labels.

@@ -32,9 +31,10 @@ return Math.round(num * shift)/shift; }; - var data = []; + var data = [], smalldata = []; for (var i = 0, n = 1; i < 63; i++, n *= 2) { data.push([i, n]); + smalldata.push([i, Math.pow(10,-n)]); } var suffixes = ['', 'k', 'M', 'G', 'T']; @@ -58,7 +58,16 @@ }); var g3 = new Dygraph(document.getElementById("labelsKMG2yValueFormatter"), data, { labelsKMG2: true, - yValueFormatter: formatValue, + axes: { + y: { + valueFormatter: formatValue + } + }, + labels: ['Base', 'Power'] + }); + + var g4 = new Dygraph(document.getElementById("labelsKMG2SmallNumbers"), smalldata, { + labelsKMG2: true, labels: ['Base', 'Power'] });