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

Inconsistent behavior when using limits and new data points #813

Open
estanglerbm opened this issue Apr 11, 2024 · 0 comments
Open

Inconsistent behavior when using limits and new data points #813

estanglerbm opened this issue Apr 11, 2024 · 0 comments

Comments

@estanglerbm
Copy link

Let's say that you have a chart with limits min/max = 'original', so that panning/zooming never exceeds the range of data points.

Then new data points arrive. (Like another day of data points with time x-axis, and we drop the oldest day of data points.)

  1. In the initial chart display--or after a resetZoom()--when the new data points arrive, they get displayed.

  2. But if you're zoomed and/or panned, and new data points arrive, then you cannot visit the new data points (by zooming out or panning over); the original range of data points is set in stone due to storeOriginalScaleLimits().

A partial workaround for zooming out is to call resetZoom() once you've zoomed all the way out:

onZoomComplete: ({chart}) => {

	if( !this.is_resetting_zoom && chart.getZoomLevel() == 1 ) {

		this.is_resetting_zoom = true;
		chart.resetZoom();
		this.is_resetting_zoom = false;
	}
}

No workaround for when you're zoomed in or panning.

I know you could update limits min/max with the range of the new data (like in #649), as it arrives, but that information may not be available, and not as convenient.

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

1 participant