Fix bug 329 which accumulates clipping rectangles on subsequent draws.
[dygraphs.git] / dygraph-layout.js
index 6b9adaf..a14e7f6 100644 (file)
@@ -58,6 +58,7 @@ DygraphLayout.prototype.getPlotArea = function() {
 
 // Compute the box which the chart should be drawn in. This is the canvas's
 // box, less space needed for axis and chart labels.
+// NOTE: This should only be called by Dygraph.predraw_().
 DygraphLayout.prototype.computePlotArea = function() {
   var area = {
     // TODO(danvk): per-axis setting.
@@ -129,7 +130,7 @@ DygraphLayout.prototype.setAnnotations = function(ann) {
   var parse = this.attr_('xValueParser') || function(x) { return x; };
   for (var i = 0; i < ann.length; i++) {
     var a = {};
-    if (!ann[i].xval && !ann[i].x) {
+    if (!ann[i].xval && ann[i].x === undefined) {
       this.dygraph_.error("Annotations must have an 'x' property");
       return;
     }