From: Dan Vanderkam Date: Sun, 10 Apr 2011 18:40:55 +0000 (-0400) Subject: use CSS to color legend labels (fixes long-standing issue in demo.html) X-Git-Tag: v1.0.0~524^2~4 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=bafe040e9908bc7ab46bab27a7323cf52c4c3dd8;p=dygraphs.git use CSS to color legend labels (fixes long-standing issue in demo.html) --- diff --git a/dygraph.js b/dygraph.js index fe677f2..f2bcaec 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1699,10 +1699,10 @@ Dygraph.prototype.generateLegendHTML_ = function(x, sel_points) { var labels = this.attr_('labels'); var html = ''; for (var i = 1; i < labels.length; i++) { - var c = new RGBColor(this.plotter_.colors[labels[i]]); + var c = this.plotter_.colors[labels[i]]; if (i > 1) html += (sepLines ? '
' : ' '); - html += "—" + labels[i] + - ""; + html += "—" + labels[i] + + ""; } return html; } @@ -1719,11 +1719,11 @@ Dygraph.prototype.generateLegendHTML_ = function(x, sel_points) { if (!Dygraph.isOK(pt.canvasy)) continue; if (sepLines) html += "
"; - var c = new RGBColor(this.plotter_.colors[pt.name]); + var c = this.plotter_.colors[pt.name]; var yval = fmtFunc(pt.yval, displayDigits); // TODO(danvk): use a template string here and make it an attribute. - html += " " - + pt.name + ":" + html += " " + + pt.name + ":" + yval; } return html;