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 628 forks source link

Is there a way to re-render data without resetChart #261

Open woodyiorl opened 2 years ago

woodyiorl commented 2 years ago

I use resetChart, but the problem is every time after resetting, the cursor will go back to the right head of data.

I am a front end newbie. Say I have the use case where user scroll to the left (reaches end of current data) and expect the chart to render the data incrementally and asynchronously fetched from backend, how can I do that?

black-hawk85 commented 2 years ago

Not sure if this works but you can try using a key

<template
  <trading-vue :key="resetkey" ... />
</template>

<script>
export default {
  data() {
    return {
      resetkey: 0
    }
  }
  methods: {
    rerender() {
      this.resetkey++;
    }
  }
}
</script>