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

SetMaxValue does not update the label if "this.max" is used in the label #59

Open
sharky98 opened this issue Dec 1, 2021 · 2 comments

Comments

@sharky98
Copy link

sharky98 commented Dec 1, 2021

Title says it all. Basically, I have using the configuration below for labels

label: function(value) {
    return Math.round(value) + "/" + this.max;
}

But, when I use the setMaxValue() function there, it will not update the this.max in the label.

svg-gauge/src/gauge.js

Lines 303 to 305 in 5fd44a3

setMaxValue: function(max) {
limit = max;
},

I tried to replace this.max by this.limit, as it is the internal variable, but the label shows as NaN instead.

svg-gauge/src/gauge.js

Lines 303 to 305 in 5fd44a3

setMaxValue: function(max) {
limit = max;
},

@sharky98
Copy link
Author

sharky98 commented Dec 1, 2021

By the way, I have another way around. I wanted to configure the gauge outside of an ajax call and just update the values afterwards so that any refreshed values will be updated, but I'll go the other way around to create (and recreate) the chart each time the values are updated.

@naikus
Copy link
Owner

naikus commented Dec 3, 2021

Thanks for filing this issue. I'll look into this.

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