diff --git a/Candles.js b/Candles.js index 9a2303e47..7daa2bf90 100644 --- a/Candles.js +++ b/Candles.js @@ -50,6 +50,7 @@ let candles = []; // Here we keep the candles to be ploted every time the Draw() function is called by the AAWebPlatform. + let onMouseOverEventSuscriptionId let zoomChangedEventSubscriptionId let offsetChangedEventSubscriptionId let dragFinishedEventSubscriptionId @@ -63,7 +64,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); @@ -120,6 +121,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. */ @@ -137,6 +139,11 @@ } } + function onMouseOver(event) { + let userPosition = getDateFromPoint(event, thisObject.container, coordinateSystem) + userPositionDate = userPosition.valueOf() + } + function getContainer(point) { try { @@ -462,9 +469,6 @@ try { - let userPosition = getUserPosition() - let userPositionDate = userPosition.point.x - if (candles.length > 0) { /* Now we calculate all the points. */ diff --git a/Volumes.js b/Volumes.js index 82521b61b..185fa070d 100644 --- a/Volumes.js +++ b/Volumes.js @@ -49,6 +49,7 @@ let volumes = []; // Here we keep the volumes to be ploted every time the Draw() function is called by the AAWebPlatform. + let onMouseOverEventSuscriptionId let zoomChangedEventSubscriptionId let offsetChangedEventSubscriptionId let dragFinishedEventSubscriptionId @@ -62,7 +63,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); @@ -119,6 +120,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. */ @@ -140,6 +142,11 @@ } } + function onMouseOver(event) { + let userPosition = getDateFromPoint(event, thisObject.container, coordinateSystem) + userPositionDate = userPosition.valueOf() + } + function recalculateScale() { recalculateScaleX(); @@ -522,9 +529,6 @@ try { - let userPosition = getUserPosition() - let userPositionDate = userPosition.point.x - if (volumes.length > 0) { /* Now we calculate and plot the volumes */