diff --git a/ChartsSpace/TimeMachine.js b/ChartsSpace/TimeMachine.js index ddbdfd7c2..1f21cb7a2 100644 --- a/ChartsSpace/TimeMachine.js +++ b/ChartsSpace/TimeMachine.js @@ -141,6 +141,10 @@ function newTimeMachine () { thisObject.rateScale.onMouseOverSomeTimeMachineContainer(event) thisObject.rateScale.visible = true } + if (thisObject.timeFrameScale !== undefined) { + thisObject.timeFrameScale.onMouseOverSomeTimeMachineContainer(event) + thisObject.timeFrameScale.visible = true + } } onMouseNotOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver) @@ -152,6 +156,9 @@ function newTimeMachine () { if (thisObject.rateScale !== undefined) { thisObject.rateScale.visible = false } + if (thisObject.timeFrameScale !== undefined) { + thisObject.timeFrameScale.visible = false + } } callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE) @@ -210,6 +217,7 @@ function newTimeMachine () { if (timeFrame !== currentTimeFrame) { for (let i = 0; i < thisObject.timelineCharts.length; i++) { let timelineChart = thisObject.timelineCharts[i] + timelineChart.upstreamTimeFrame = timeFrame if (timelineChart.timeFrameScale === undefined) { timelineChart.plotterManager.setTimeFrame(timeFrame) } @@ -296,6 +304,12 @@ function newTimeMachine () { if (thisObject.payload.node.rateScale !== undefined && thisObject.rateScale === undefined) { initializeRateScale() } + if (thisObject.payload.node.timeFrameScale === undefined && thisObject.timeFrameScale !== undefined) { + finalizeTimeFrameScale() + } + if (thisObject.payload.node.timeFrameScale !== undefined && thisObject.timeFrameScale === undefined) { + initializeTimeFrameScale() + } } function syncWithDesignerTimelineCharts () { @@ -382,6 +396,9 @@ function newTimeMachine () { if (thisObject.rateScale !== undefined) { thisObject.rateScale.physics() } + if (thisObject.timeFrameScale !== undefined) { + thisObject.timeFrameScale.physics() + } for (let i = 0; i < thisObject.timelineCharts.length; i++) { let timelineChart = thisObject.timelineCharts[i] @@ -407,6 +424,7 @@ function newTimeMachine () { if (thisObject.timeScale !== undefined) { thisObject.timeScale.draw() } if (thisObject.rateScale !== undefined) { thisObject.rateScale.draw() } + if (thisObject.timeFrameScale !== undefined) { thisObject.timeFrameScale.draw() } thisObject.container.frame.draw(false, true, false, thisObject.fitFunction) } diff --git a/ChartsSpace/TimelineChart.js b/ChartsSpace/TimelineChart.js index 12e6ad5a4..ad84e6998 100644 --- a/ChartsSpace/TimelineChart.js +++ b/ChartsSpace/TimelineChart.js @@ -17,6 +17,7 @@ function newTimelineChart () { timeFrameScale: undefined, payload: undefined, plotterManager: undefined, + upstreamTimeFrame: undefined, physics: physics, drawBackground: drawBackground, draw: draw, @@ -86,6 +87,10 @@ function newTimelineChart () { thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleMouseOverEventSuscriptionId) thisObject.timeFrameScale.finalize() thisObject.timeFrameScale = undefined + if (thisObject.upstreamTimeFrame !== undefined) { + timeFrame = thisObject.upstreamTimeFrame + thisObject.plotterManager.setTimeFrame(timeFrame) + } } function initialize (pExchange, pMarket, pTimeLineCoordinateSystem, callBackFunction) {