diff --git a/Plotter.js b/Plotter.js index 0f90ee3c5..32a4f3ff4 100644 --- a/Plotter.js +++ b/Plotter.js @@ -8,6 +8,7 @@ function newPlotter () { let thisObject = { currentRecord: undefined, container: undefined, + fitFunction: undefined, onDailyFileLoaded: onDailyFileLoaded, initialize: initialize, finalize: finalize, @@ -67,6 +68,7 @@ function newPlotter () { marketFiles.eventHandler.stopListening(marketFilesUpdatedEventSubscriptionId) dailyFiles.eventHandler.stopListening(dailyFilesUpdatedEventSubscriptionId) thisObject.container.eventHandler.stopListening(onDisplaceEventSubscriptionId) + thisObject.fitFunction = undefined /* Clear References */ marketFiles = undefined @@ -724,6 +726,7 @@ function newPlotter () { } /* We make sure the points do not fall outside the viewport visible area. This step allways need to be done. */ dataPoint = canvas.chartSpace.viewport.fitIntoVisibleArea(dataPoint) + dataPoint = thisObject.fitFunction(dataPoint) if (k === 0) { browserCanvasContext.moveTo(dataPoint.x, dataPoint.y) } else {