Forcing Bottom Chart to Redraw

Custom indicators, trading strategies, data export and recording and more...
travis_russi
Posts: 1
Joined: Sun Aug 22, 2021 8:55 pm
Has thanked: 1 time

Forcing Bottom Chart to Redraw

Post by travis_russi » Tue Oct 26, 2021 5:49 pm

In the bottom chart, the graph becomes smaller in the X axis over time to the point of being an almost straight horizontal line.  Minimizing the bottom chart, then reshowing performs a recalculation of the X axis and the graph looks better.  Picking a different time slice also redraws the bottom chart properly.

Is there a way within the JS API to issue a redraw command for the bottom chart?

I saw the 'reload' command, but that seems a bit heavy-handed.
Documentation for Reload

Also, I tried wrapping the 'api.reload()' command in a 'setTimeout', but the parser complained about 'setTimeout'.  Is there a simple implementation that can call the 'reload' or a 'redraw' function every 30 seconds?

This is what I tried unsuccessfully:

Code: Select all

 
setTimeout(function() {
    api.reload();
}, 30000);

AndreyR
Posts: 421
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 17 times
Been thanked: 71 times

Re: Forcing Bottom Chart to Redraw

Post by AndreyR » Thu Nov 04, 2021 10:28 am

Hi, sorry for a delayed response.
graph becomes smaller in the X axis over time to the point of being an almost straight horizontal line.
this looks like a bug, we will investigate it.

Post Reply