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:
710ac67
)
legend: follow positioning fixes
author
Marek Janda
<nyx@nyx.cz>
Wed, 18 Feb 2015 10:21:37 +0000
(11:21 +0100)
committer
Marek Janda
<nyx@nyx.cz>
Wed, 18 Feb 2015 10:21:37 +0000
(11:21 +0100)
plugins/legend.js
patch
|
blob
|
blame
|
history
diff --git
a/plugins/legend.js
b/plugins/legend.js
index
b54770f
..
91e9ddd
100644
(file)
--- a/
plugins/legend.js
+++ b/
plugins/legend.js
@@
-141,13
+141,13
@@
legend.prototype.select = function(e) {
// within the plotter_ area
// offset 20 px to the right and down from the first selection point
// 20 px is guess based on mouse cursor size
// within the plotter_ area
// offset 20 px to the right and down from the first selection point
// 20 px is guess based on mouse cursor size
- var leftLegend = points[0].x * area.w +
2
0;
- var topLegend = points[0].y * area.h -
2
0;
+ var leftLegend = points[0].x * area.w +
5
0;
+ var topLegend = points[0].y * area.h -
5
0;
- // if legend floats to end of the
window
area, it flips to the other
+ // if legend floats to end of the
chart
area, it flips to the other
// side of the selection point
// side of the selection point
- if ((leftLegend + labelsDivWidth + 1) >
(window.scrollX + window.innerWidth)
) {
- leftLegend = leftLegend - 2 *
2
0 - labelsDivWidth - (yAxisLabelWidth - area.x);
+ if ((leftLegend + labelsDivWidth + 1) >
area.w
) {
+ leftLegend = leftLegend - 2 *
5
0 - labelsDivWidth - (yAxisLabelWidth - area.x);
}
e.dygraph.graphDiv.appendChild(this.legend_div_);
}
e.dygraph.graphDiv.appendChild(this.legend_div_);