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

Method Refresh doesn't work with Value zero. #359

Closed
louagej opened this issue Feb 14, 2021 · 2 comments
Closed

Method Refresh doesn't work with Value zero. #359

louagej opened this issue Feb 14, 2021 · 2 comments

Comments

@louagej
Copy link
Contributor

louagej commented Feb 14, 2021

Hi,

When the Gauge has a minimum value different from 0 and you simply want to set the min value back to zero, it just seem to be ignored.
I started from the example in the repository (docs\examples\refresh-minimum-maximum.html) and added an extra button to refresh the min value.

document.getElementById('g1_setmin0').addEventListener('click', function () {
                g1.refresh(g1.originalValue, 100, 0);
                return false;
            });

Watch the result below and you can see the min doesn't change.
ezgif-3-a6a5d9baebd3

Is there another way to achieve the minimum value back to zero?

Regards,
Job

@robertsLando
Copy link
Collaborator

@louagej Seems the problem is here: https://github.com/toorshia/justgage/blob/master/justgage.js#L842

This line should check if min/max are numbers, when min or max are 0 that will set them to null. WOuld you like to send a PR for that?

@louagej
Copy link
Contributor Author

louagej commented Feb 15, 2021

Hi @robertsLando,
I just created a pull request.
I hope I did the right thing, never created a pull request for this repo

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

2 participants