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

Cannot set min prop other than 0 #16

Open
bagaskarala opened this issue Jul 1, 2020 · 2 comments
Open

Cannot set min prop other than 0 #16

bagaskarala opened this issue Jul 1, 2020 · 2 comments

Comments

@bagaskarala
Copy link

Cannot set min prop to other than 0.

Step to reproduce: Just change min prop to -10 or 20, then the gauge will error
demo : https://hellocomet.github.io/vue-svg-gauge/

@martynwheeler
Copy link

I am having the same issue, min values of anything other than 0 give very odd looking gauges. The ticks are all over the place. Would be really nice to have a fix for this.

Thank you

@Marandil
Copy link

Apparently the bug is in getAngle(value) method. As far as I can tell, changing:

-        return ((value * totalAngle) / totalValue) + startAngle
+        return (((value - min) * totalAngle) / totalValue) + startAngle

solves the issue.

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

3 participants