X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=inline;f=tests%2Fdygraph-many-points-benchmark.html;h=17dadcd5c9140da6eee6877c698f6981fc98fb0e;hb=dfadd73f24bd6369cb814b186b0ffedf99cbed9a;hp=7d887b94ced90c97b1e3d0cea6834833f2f77c47;hpb=3044a6bd1d26486af684a833a1de84be9dd7c2a9;p=dygraphs.git diff --git a/tests/dygraph-many-points-benchmark.html b/tests/dygraph-many-points-benchmark.html index 7d887b9..17dadcd 100644 --- a/tests/dygraph-many-points-benchmark.html +++ b/tests/dygraph-many-points-benchmark.html @@ -19,10 +19,15 @@
Data to plot:
sinusoid function
+ onclick="setDataType(this);" checked> sinusoid function
random points
Number of points (points):
+ onclick="setDataType(this);"> random points
Timestamps: + aligned + unaligned
+Number of points per series (points):
Number of series (series):
@@ -43,6 +48,7 @@ var graph = null; var metrics = null; var dataType = "sine"; + var timestamps = "aligned"; var durations = []; updatePlot = function() { @@ -61,6 +67,7 @@ var xmax = 2.0 * Math.PI; var adj = .5; var delta = (xmax - xmin) / (numPoints - 1); + var unalignmentDelta = delta / numSeries; for (var i = 0; i < numPoints; ++i) { var x = xmin + delta * i; @@ -74,7 +81,15 @@ } elem.push(y); } - data[i] = elem; + if (timestamps == "aligned") { + data[i] = elem; + } else { + for (var j = 0; j < numSeries; j++) { + var elemCopy = elem.slice(0); + elemCopy[0] += unalignmentDelta * j; + data[i*numSeries + j] = elemCopy; + } + } } var labels = [ "x" ]; for (var j = 0; j < numSeries; j++) { @@ -128,16 +143,19 @@ return millisecondss; }; - clickedRadioButton = function(radiobutton) { + setDataType = function(radiobutton) { dataType = radiobutton.value; }; + setTimestampType = function(radiobutton) { + timestamps = radiobutton.value; + }; var values = { points: 100, series: 1, rollPeriod: 1, repetitions: 1, - type: 'sine', + type: 'sine' }; // Parse the URL for parameters. Use it to override the values hash.