Skip to content

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

Open
@GitCatacao

Description

@GitCatacao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions