tvjsx / trading-vue-js

💹 Hackable charting lib for traders. You can draw literally ANYTHING on top of candlestick charts. [Not Maintained]
https://tvjsx.github.io/trading-vue-demo/
MIT License
2.07k stars 629 forks source link

goto seems only to be working on second call when data is not loaded yet #219

Open tfonfara opened 3 years ago

tfonfara commented 3 years ago

Description

By calling goto(t) when t is outside the loaded data rage, the correct chunk loading is being triggered, but the chart first jumps to the desired time range, jumps then back to the current time. Once the data loading is done and I trigger goto(t) again, everything works as expected. How can I avoid this and jump to t right away or can be informed that the loading is done so I can call goto(t) again?

Code

Code can be based on DataHelper.vue from tests, but requires a dynamic chunk loading.

<button v-on:click="goto">GOTO</button>

methods: {
    goto() {
        this.$refs.tvjs.goto(<timestamp>)
    }
}

Environment

Component Version
TradingVue.js 1.0.2
Vue.js 2.6.12
tfonfara commented 3 years ago

Additional info: once I call goto(t) the second time and the chart is at the correct time range the chart crashes on scrolling (100% cpu load, page not responding any longer), tested on Chrome and Safari