From bafe040e9908bc7ab46bab27a7323cf52c4c3dd8 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sun, 10 Apr 2011 14:40:55 -0400 Subject: [PATCH] use CSS to color legend labels (fixes long-standing issue in demo.html) --- dygraph.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; -- 2.7.4