projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
11ce506
)
Check for visible viewport width, not the plotter width
author
Petr Shevtsov
<petr.shevtsov@gmail.com>
Thu, 13 Nov 2014 15:02:29 +0000
(18:02 +0300)
committer
Petr Shevtsov
<petr.shevtsov@gmail.com>
Thu, 13 Nov 2014 15:02:29 +0000
(18:02 +0300)
plugins/legend.js
patch
|
blob
|
blame
|
history
diff --git
a/plugins/legend.js
b/plugins/legend.js
index
90803f6
..
3349969
100644
(file)
--- a/
plugins/legend.js
+++ b/
plugins/legend.js
@@
-128,7
+128,7
@@
legend.prototype.select = function(e) {
var xValue = e.selectedX;
var points = e.selectedPoints;
var xValue = e.selectedX;
var points = e.selectedPoints;
- if(e.dygraph.getOption("legendFollow")) {
+ if
(e.dygraph.getOption("legendFollow")) {
// create floating legend div
var area = e.dygraph.plotter_.area;
var labelsDivWidth = e.dygraph.getOption("labelsDivWidth");
// create floating legend div
var area = e.dygraph.plotter_.area;
var labelsDivWidth = e.dygraph.getOption("labelsDivWidth");
@@
-142,8
+142,8
@@
legend.prototype.select = function(e) {
// if legend floats to end of the plotting area, it flips to the other
// side of the selection point
// if legend floats to end of the plotting area, it flips to the other
// side of the selection point
- if
((leftLegend + labelsDivWidth + 1) > area.w
) {
- leftLegend = leftLegend - 2
*
20 - labelsDivWidth - (yAxisLabelWidth - area.x);
+ if
((leftLegend + labelsDivWidth + 1) > (window.scrollX + window.innerWidth)
) {
+ leftLegend = leftLegend - 2
*
20 - labelsDivWidth - (yAxisLabelWidth - area.x);
}
e.dygraph.graphDiv.appendChild(this.legend_div_);
}
e.dygraph.graphDiv.appendChild(this.legend_div_);