X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2FlabelsKMB.html;h=1a4d5c9476a62545721e06cdfe2a769006ca4b68;hb=bef79a5b598ff3bfd0a0cbfe756c82f3945c18b0;hp=18e33c5cf43f6db05a1af122a345bd273e11c7cc;hpb=10494b48b43d9ca8710d441d3c530c7d546f3edf;p=dygraphs.git diff --git a/tests/labelsKMB.html b/tests/labelsKMB.html index 18e33c5..1a4d5c9 100644 --- a/tests/labelsKMB.html +++ b/tests/labelsKMB.html @@ -6,10 +6,12 @@ - - - - + + +
labelsKMB:
@@ -21,6 +23,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.
@@ -30,9 +35,10 @@ return Math.round(num * shift)/shift; }; - var data = []; - for (var i = 0, n = 1; i < 43; i++, n *= 2) { + 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']; @@ -46,10 +52,24 @@ suffixes[magnitude]; } - new Dygraph(document.getElementById("labelsKMB"), data, { labelsKMB: true }); - new Dygraph(document.getElementById("labelsKMG2"), data, { labelsKMG2: true }); - var g = new Dygraph(document.getElementById("labelsKMG2yValueFormatter"), data, - { labelsKMG2: true, yValueFormatter: formatValue }); + var g = new Dygraph(document.getElementById("labelsKMB"), data, { + labelsKMB: true, + labels: ['Base', 'Power'] + }); + var g2 = new Dygraph(document.getElementById("labelsKMG2"), data, { + labelsKMG2: true, + labels: ['Base', 'Power'] + }); + var g3 = new Dygraph(document.getElementById("labelsKMG2yValueFormatter"), data, { + labelsKMG2: true, + yValueFormatter: formatValue, + labels: ['Base', 'Power'] + }); + + var g4 = new Dygraph(document.getElementById("labelsKMG2SmallNumbers"), smalldata, { + labelsKMG2: true, + labels: ['Base', 'Power'] + });