0

I need to load data until it fills the visible area. But on setData the graph changes the visible area, which leads to endless data loading. It looks something like this https://jsfiddle.net/beholderrk/916g3tcf/3/

Is there any way to setData did not lead to a shift in the visible region of timeScale()?

beholderrk
  • 730
  • 8
  • 17

2 Answers2

1

It seems that there is a bug when you set data via setData and the library moves visible range and I think that it shouldn't do it (it should work the same as if you have the last bar visible). I'd suggest you file an issue on github so we can mark it as a bug and fix in future versions.

timocov
  • 1,088
  • 6
  • 16
0

I have forked the fiddle with what I think you want to achieve. You just need to add:

chart.applyOptions({
  priceScale:{
    autoScale: false,
  }
})

after the declaration. I also added a commented section in case you want to change the price scale:

// To set a different scale
  /*autoscaleInfoProvider: () => ({
    priceRange: {
      minValue: 170,
      maxValue: 300,
    },
  }),*/

I did not find any condition where the animation stops, though. Only when you press the stop button. You would need to add that part.

vqf
  • 2,600
  • 10
  • 16
  • Thx for answer. I want the `timeScale` not move to the right when `setData`. autoScale changes behaviour of `priceScale`, not `timeScale` – beholderrk Aug 24 '20 at 11:48