-
-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Overlay that extends the last data point will be positioned wrong if new data are appended #516
Comments
You have to create the overlay using Or update the overlay instance after new (historical) data is loaded. |
I obviously write the overlay is past the last data point. When an overlay is stretched past the last data point, the point values does not contain a timestamp key, because there is no timestamp. |
14.03.2024.15.22.06.webmI join the question. If you do not specify the The offset occurs because the initial index also changes during dynamic loading of data. Thus, if I load 300 candlesticks each time I scroll to the left, the index of the point does not change and it probably needs to be changed manually. Is it possible to use timestamp instead of dataIndex or how to updat? How would you recommend updating the dataIndex in this case? |
An easy way is to store the dataIndex without timestamp as negative value, thus -1 means the last dataIndex. |
Explain why the overlay can only be drawn to future time using dataIndex instead of timestamp. Currently, the chart does not have periods and trading sessions, but is rendered based on data, so it is impossible to determine an accurate time in the future. |
Which is why in Chart.updateData you need to update dataIndex of overlay coordinates that have no timestamp because the dataIndex has been shifted. |
It seems that a bug has been found on my side. In my case, I don't have to save dataIndex to DB and everywhere to use milliseconds format of timestamp! |
Yes, I am trying to fix it. |
There is also the problem of restoring an overlay (from database) where coordinates contains only For example: // 3 bars after 1710753641000
{timestamp: 1710753641000, offset: 3}
// 3 bars before 1710753641000
{timestamp: 1710753641000, offset: -3} |
This problem has been completely solved. In v10, the overlay only uses the timestamp to control its position. |
Version
latest
Steps to Reproduce
Current Behavior
Right point of overlay is misplaced.
Expected Behavior
Right point position is retained.
Environment
Any additional comments?
When adding new data,
dataIndex
points in overlays that do not have a timestamp need to be updated with the new data length.The text was updated successfully, but these errors were encountered: