Skip to content
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

Updating the last Candlestick entry. #1649

Closed
moon47usaco opened this issue Oct 12, 2016 · 2 comments
Closed

Updating the last Candlestick entry. #1649

moon47usaco opened this issue Oct 12, 2016 · 2 comments

Comments

@moon47usaco
Copy link

I see lots of issues and resolutions for realtime charts that use addEntry and notifyDataSetChanged and that is all fine and good.

What about updating the current last entry. Say I have a 30 minute bar with open,high,low, close.

If it is 10:15am I will be getting updated prices of that bar for the next 15 minutes and I do not want to add an entry until 10:30am when the new bar starts. What I want to do is check the current price that comes in, several times in a minute, and update the open,high,low, close of the 10:00am bar if necessary.

@moon47usaco
Copy link
Author

So I was thinking that I could pop the last entry off then addEntry to add it back it with the new values then notifyDataSetChanged. Unless there is a better way than that?

@liuxuan30
Copy link
Member

liuxuan30 commented Oct 14, 2016

you just get whatever data you want and simply re-create the data or just update your entry, and then refresh the chart.
If you take a look at draw() method, it simply render everything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants