projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
bafe040
)
only show visible series on the legend
author
Dan Vanderkam
<dan@dygraphs.com>
Sun, 10 Apr 2011 19:01:40 +0000
(15:01 -0400)
committer
Dan Vanderkam
<dan@dygraphs.com>
Sun, 10 Apr 2011 19:01:40 +0000
(15:01 -0400)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
f2bcaec
..
4227652
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-1699,8
+1699,9
@@
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++) {
+ if (!this.visibility()[i - 1]) continue;
var c = this.plotter_.colors[labels[i]];
var c = this.plotter_.colors[labels[i]];
- if (
i > 1
) html += (sepLines ? '<br/>' : ' ');
+ if (
html != ''
) html += (sepLines ? '<br/>' : ' ');
html += "<b><span style='color: " + c + ";'>—" + labels[i] +
"</span></b>";
}
html += "<b><span style='color: " + c + ";'>—" + labels[i] +
"</span></b>";
}