From 17972ccedc22342a42fd8c2fb0a1a52806152ad7 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 30 Jan 2020 22:04:42 +0100 Subject: [PATCH] no more getUserPosition --- BollingerBands.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BollingerBands.js b/BollingerBands.js index 9f49ced58..28d549aa0 100644 --- a/BollingerBands.js +++ b/BollingerBands.js @@ -51,6 +51,7 @@ let bands = []; // Here we keep the bands to be ploted every time the Draw() function is called by the AAWebPlatform. + let onMouseOverEventSuscriptionId let zoomChangedEventSubscriptionId let offsetChangedEventSubscriptionId let dragFinishedEventSubscriptionId @@ -64,7 +65,7 @@ try { /* Stop listening to the necesary events. */ - + thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId) canvas.chartSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId); canvas.chartSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId); canvas.eventHandler.stopListening(dragFinishedEventSubscriptionId); @@ -122,6 +123,7 @@ dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent("Drag Finished", onDragFinished); marketFilesUpdatedEventSubscriptionId = marketFiles.eventHandler.listenToEvent("Files Updated", onMarketFilesUpdated); dailyFilesUpdatedEventSubscriptionId = dailyFiles.eventHandler.listenToEvent("Files Updated", onDailyFilesUpdated); + onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver) /* Get ready for plotting. */ @@ -139,6 +141,11 @@ } } + function onMouseOver(event) { + let userPosition = getDateFromPoint(event, thisObject.container, coordinateSystem) + userPositionDate = userPosition.valueOf() + } + function getContainer(point) { try { @@ -460,9 +467,6 @@ try { - let userPosition = getUserPosition() - let userPositionDate = userPosition.point.x - let band; let previousBand;