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

Seeking guidance on creating a dynamic chart with the following features #942

Open
Hameed2000 opened this issue Apr 16, 2024 · 2 comments
Open
Labels
question Further information is requested

Comments

@Hameed2000
Copy link

Hey, thanks for this amazing library.

I'm trying to create a chart with the following features all at once but am running into trouble.

Features:
Dynamically updating chart that keeps old data
Ability to zoom and pan
The chart should have a scrolling effect that stops once the user isn't viewing live data but continues once live data is in range again

@Hameed2000
Copy link
Author

I'm able to pan and zoom and keep old data but I can't figure out how to do the scrolling effect when the user isn't viewing live data and continuing the scrolling effect once live data is in view again.

Also I run into an issue where points stop being drawn unless I am interacting with the chart through panning or zooming.

@leeoniya
Copy link
Owner

leeoniya commented May 3, 2024

I can't figure out how to do the scrolling effect when the user isn't viewing live data and continuing the scrolling effect once live data is in view again.

you should call setData with false second arg to prevent it from setting the x scale to match the new data.

uPlot/dist/uPlot.d.ts

Lines 73 to 74 in e579947

/** sets the chart data & redraws. (default resetScales = true) */
setData(data: uPlot.AlignedData, resetScales?: boolean): void;

@leeoniya leeoniya added the question Further information is requested label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants