Merge pull request #125 from jllodra/master
authorDan Vanderkam <dan@dygraphs.com>
Mon, 27 Feb 2012 16:21:11 +0000 (08:21 -0800)
committerDan Vanderkam <dan@dygraphs.com>
Mon, 27 Feb 2012 16:21:11 +0000 (08:21 -0800)
fixed: css3 labelsDivStyles crashed in IE8

1  2 
dygraph.js

diff --combined dygraph.js
@@@ -1002,9 -1002,13 +1002,13 @@@ Dygraph.prototype.createStatusMessage_ 
      var div = document.createElement("div");
      div.className = "dygraph-legend";
      for (var name in messagestyle) {
-       if (messagestyle.hasOwnProperty(name)) {
-         div.style[name] = messagestyle[name];
-       }
+       if (messagestyle.hasOwnProperty(name)) {
+           try {
+               div.style[name] = messagestyle[name];
+           } catch (e) {
+               this.warn("You are using unsupported css properties for your browser in labelsDivStyles");
+           }
+       }
      }
      this.graphDiv.appendChild(div);
      this.attrs_.labelsDiv = div;
@@@ -1761,12 -1765,10 +1765,12 @@@ Dygraph.prototype.updateSelection_ = fu
        if (!Dygraph.isOK(pt.canvasy)) continue;
  
        var circleSize = this.attr_('highlightCircleSize', pt.name);
 -      ctx.beginPath();
 -      ctx.fillStyle = this.plotter_.colors[pt.name];
 -      ctx.arc(canvasx, pt.canvasy, circleSize, 0, 2 * Math.PI, false);
 -      ctx.fill();
 +      var callback = this.attr_("drawHighlightPointCallback", pt.name);
 +      if (!callback) {
 +        callback = Dygraph.Circles.DEFAULT;
 +      }
 +      callback(this.g, pt.name, ctx, canvasx, pt.canvasy,
 +          this.plotter_.colors[pt.name], circleSize);
      }
      ctx.restore();