projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5bc3e26
)
use CSS to color legend labels (fixes long-standing issue in demo.html)
author
Dan Vanderkam
<dan@dygraphs.com>
Sun, 10 Apr 2011 18:40:55 +0000
(14:40 -0400)
committer
Dan Vanderkam
<dan@dygraphs.com>
Sun, 10 Apr 2011 18:40:55 +0000
(14:40 -0400)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
fe677f2
..
f2bcaec
100644
(file)
--- 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 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 ? '<br/>' : ' ');
if (i > 1) html += (sepLines ? '<br/>' : ' ');
- html += "<b><
font color='" + c.toHex() + "
'>—" + labels[i] +
- "</
font
></b>";
+ html += "<b><
span style='color: " + c + ";
'>—" + labels[i] +
+ "</
span
></b>";
}
return html;
}
}
return html;
}
@@
-1719,11
+1719,11
@@
Dygraph.prototype.generateLegendHTML_ = function(x, sel_points) {
if (!Dygraph.isOK(pt.canvasy)) continue;
if (sepLines) html += "<br/>";
if (!Dygraph.isOK(pt.canvasy)) continue;
if (sepLines) html += "<br/>";
- 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.
var yval = fmtFunc(pt.yval, displayDigits);
// TODO(danvk): use a template string here and make it an attribute.
- html += " <b><
font color='" + c.toHex() + "
'>"
- + pt.name + "</
font
></b>:"
+ html += " <b><
span style='color: " + c + ";
'>"
+ + pt.name + "</
span
></b>:"
+ yval;
}
return html;
+ yval;
}
return html;