[Plot] Restrict hover coordinates

Only show hover coordinates in a stacked plot for
the plot which the user is specifically hovering
over. WTD-625.
This commit is contained in:
Victor Woeltjen
2014-12-11 17:09:08 -08:00
parent 1b6ce10dd9
commit 9344809998
2 changed files with 12 additions and 3 deletions

View File

@ -19,7 +19,8 @@ define(
formatter = new PlotFormatter(),
domainOffset,
mousePosition,
marqueeStart;
marqueeStart,
isHovering = false;
// Utility, for map/forEach loops. Index 0 is domain,
// index 1 is range.
@ -157,6 +158,7 @@ define(
* @param $event the mouse event
*/
hover: function ($event) {
isHovering = true;
mousePosition = toMousePosition($event);
if (marqueeStart) {
updateMarqueeBox();
@ -194,6 +196,12 @@ define(
},
setDomainOffset: function (value) {
domainOffset = value;
},
isHovering: function (state) {
if (state !== undefined) {
isHovering = state;
}
return isHovering;
}
};
}