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

Add periodically data update example for jvm-swing-javafx #2

Open
fmvin opened this issue Sep 24, 2022 · 6 comments
Open

Add periodically data update example for jvm-swing-javafx #2

fmvin opened this issue Sep 24, 2022 · 6 comments

Comments

@fmvin
Copy link

fmvin commented Sep 24, 2022

Please create an example for demonstrating plotting in realtime. For example math or rand function updates each second.
jvm-swing-javafx example is much preferable.

@alshan
Copy link
Owner

alshan commented Sep 27, 2022

Ho @fmvin , this must be some trick with offscreen drawing of kind. Perhaps CardLayout can help.
Lets-Plot itself doesn't support incremental updates at the moment so, every time the data is updated a brand new plot object must be created.

@fmvin
Copy link
Author

fmvin commented Sep 27, 2022

@alshan, Thanks a lot for clarification. There is no problem with creating new plot objects except an annoying chart blinking after each data update. Hope your proposal will be helpful.

@alshan
Copy link
Owner

alshan commented Sep 30, 2022

BTW, just setting the color of the backing panel in your app to the same value as the color of the plot background can reduce blinking.

@fmvin
Copy link
Author

fmvin commented Oct 3, 2022

Trick with CardLayout works exactly as I expected. On first data update I show first card and push a new chart to the second card. On next data update I show second card and push new chart to the first card. And so on.

@alshan
Copy link
Owner

alshan commented Oct 4, 2022

Wow, glad to hear!
Do you think you can share your solution?

@fmvin
Copy link
Author

fmvin commented Oct 5, 2022

I dont think this is a solution. It's just a naive trick with obvious limitations. Much better if native support of dynamic chart update will be added to Lets-Plot lib or to kotlin wrapper.

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