this.datasets[setname] = set_xy;
};
-// TODO(danvk): CONTRACT remove
DygraphLayout.prototype.setAnnotations = function(ann) {
// The Dygraph object's annotations aren't parsed. We parse them here and
// save a copy.
var parse = this.attr_('xValueParser');
for (var i = 0; i < ann.length; i++) {
var a = {};
- if (!ann[i].x) {
+ if (!ann[i].xval && !ann[i].x) {
this.dygraph_.error("Annotations must have an 'x' property");
return;
}
return;
}
Dygraph.update(a, ann[i]);
- a.xval = parse(a.x);
+ if (!a.xval) a.xval = parse(a.x);
this.annotations.push(a);
}
};
div.className += " " + a.cssClass;
}
- var width = a.hasOwnProperty('height') ? a.height : 20;
- var height = a.hasOwnProperty('width') ? a.width : 16;
+ var width = a.hasOwnProperty('width') ? a.width : 16;
+ var height = a.hasOwnProperty('height') ? a.height : 16;
if (a.hasOwnProperty('icon')) {
var img = document.createElement("img");
img.src = a.icon;