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

Hmm, didn't knew about that. It does work, as in that it also zooms to this period. #471

Closed
kurkle opened this issue Apr 26, 2021 · 0 comments · Fixed by #472
Closed

Hmm, didn't knew about that. It does work, as in that it also zooms to this period. #471

kurkle opened this issue Apr 26, 2021 · 0 comments · Fixed by #472
Labels

Comments

@kurkle
Copy link
Member

kurkle commented Apr 26, 2021

Somehow there looks to be a change to the onZoomComplete function.

In 1.0.0-beta.1 I have to use this (with curly brackets):

    onZoomComplete: function ({ chart }) {
        showHideZoomButton(chart);
    }

function showHideZoomButton(chart) {
	document.querySelector('.resetZoomButton').style.display = (chart.scales.x.options.min != 0 || chart.scales.x.options.max != 0 || chart.scales.y.options.min != 0 || chart.scales.y.options.max != 0) ? 'block' : 'none';
}

In 1.0.0-beta.2 I have to use this (without curly brackets):

    onZoomComplete: function (chart) {
        showHideZoomButton(chart);
    }

Is there any logic to this, or am I doing something wrong?

Originally posted by @KoalaBear84 in #464 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant