"labels": ["Data"],
"type": "string (URL of CSV or CSV), GViz DataTable or 2D Array",
"description": "Sets the data being displayed in the chart. This can only be set when calling updateOptions; it cannot be set from the constructor. For a full description of valid data formats, see the <a href='http://dygraphs.com/data.html'>Data Formats</a> page."
+ },
+ "timingName": {
+ "default": "null",
+ "labels": [ "Debugging" ],
+ "type": "string",
+ "description": "Set this option to log timing information. The value of the option will be logged along with the timimg, so that you can distinguish multiple dygraphs on the same page."
}
}
; // </JSON>
'Overall display',
'Rolling Averages',
'Value display/formatting',
- 'Zooming'
+ 'Zooming',
+ 'Debugging'
];
var cats = {};
for (var i = 0; i < valid_cats.length; i++) cats[valid_cats[i]] = true;
* number of axes, rolling averages, etc.
*/
Dygraph.prototype.predraw_ = function() {
+ var start = new Date();
+
// TODO(danvk): move more computations out of drawGraph_ and into here.
this.computeYAxes_();
* @private
*/
Dygraph.prototype.drawGraph_ = function(clearSelection) {
+ var start = new Date();
+
if (typeof(clearSelection) === 'undefined') {
clearSelection = true;
}
if (this.attr_("drawCallback") !== null) {
this.attr_("drawCallback")(this, is_initial_draw);
}
+
+ if (this.attr_("timingName")) {
+ var end = new Date();
+ if (console) {
+ console.log(this.attr_("timingName") + " - drawGraph: " + (end - start) + "ms")
+ }
+ }
};
/**
}
var rollPeriod = parseInt(
document.getElementById('roll_period_input').value);
- var opts = {labels: labels, rollPeriod: rollPeriod};
+ var opts = {labels: labels, rollPeriod: rollPeriod, timingName: "x"};
var millisecondss = [];
for (var i = 0; i < repetitions; i++) {
var start = new Date();