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

While the graph updates the live data the resetZoom() does not happen correctly #918

Open
GitCatacao opened this issue Jan 4, 2025 · 0 comments

Comments

@GitCatacao
Copy link

GitCatacao commented Jan 4, 2025

While the graph updates the live data the reset does not happen correctly in a graph made like this (sorry if it is too skimpy). You know what it is if you have done it.
The example is unfortunately too big to be reported here on github.
It is a financial chart with added volumes.
Two series, one volume and one interchangeable line/candlestick/ohlc.

The zoom when reset remains set to the last zoomed size.

I don't know if you can fake it, but if you can you will realize that the problem exists and it is quite annoying.

						zoom: { //plugin
							zoom: {
								wheel: {
									enabled: true,
								},
								pinch: {
									enabled: true
								},
								mode: 'x',
								limits: {
									x: {min: 0, max: 100},
								},
								onZoomStart: ({ chart, event, point }) => {
									drawOnChartZoomButton();
								},
							},
						},
....

		<div class="chart-container" id="chart-container">
			<canvas id="chart"></canvas>
		    <div id="menu_chart">
				<script>
				resetZoomBtn = (chart) => {
					chart.resetZoom()
				};
				</script>
		    	<button id="button_reset_mainchart_zoom" type="button" class="btn btn-secondary" onclick="resetZoomBtn(chart); this.style = 'display: none;';" style="display:none;">🧐</button>
		    </div>
		</div>



If you need further details just ask.

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