<body>
<p>Plot which can be easily generated with different numbers of points for
benchmarking/profiling and improving performance of dygraphs.</p>
+ <p>Data to plot:
+ <input type="radio" name="plot_group1" value="sine" onclick="clickedRadioButton(this);" checked> sinusoid function
+ <input type="radio" name="plot_group1" value="rand" onclick="clickedRadioButton(this);"> random points <br></p>
<p>Number of points:
<input type="text" id="num_points_input" size="20"></p>
<p>Number of series:
<script type="text/javascript">
var plot;
+ var dataType = "sine";
var durations = [];
updatePlot = function() {
var x = xmin + delta * i;
var elem = [ x ];
for (var j = 0; j < numSeries; j++) {
- var y = Math.sin(x + (j * adj));
+ var y;
+ if (dataType == "rand") {
+ y = Math.random() * 2 - 1;
+ } else {
+ y = Math.sin(x + (j * adj));
+ }
elem.push(y);
}
data[i] = elem;
"completed in " + (end2 - start2) + " milliseconds.";
}
};
+
+ clickedRadioButton = function(radiobutton) {
+ dataType = radiobutton.value;
+ };
+
document.getElementById('num_points_input').value = '100';
document.getElementById('num_series_input').value = '1';