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

Use canvas-gauges with electron #122

Closed
LazeBear opened this issue Mar 20, 2017 · 4 comments
Closed

Use canvas-gauges with electron #122

LazeBear opened this issue Mar 20, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@LazeBear
Copy link

As I'm pretty new to js and electron, this might be a stupid question, but I really can't find the way to solve it and here is the issue:
In the guidance, there are two ways to insert canvas gauge, the HTML way works fine for me. However, I'm struggling on the js way. when I paste the code into the js file, I got an error saying "LinearGauge is undefined".
Just wondering, in what way should I include or import canvas-gauge.
I tried, var canvas = require("canvas-gauge") but don't know how to link the canvas with the LinearGauge method.
I also tried, put the code into the HTML file inside <script> tag, that doesn't work as well.
Thanks for any help!

@LazeBear
Copy link
Author

Also, with HTML, how to updating the value like gauge.value("10") as in js.
I used JQuery to change the 'data-value' attribute, but there is no animation at all.

@Mikhus
Copy link
Owner

Mikhus commented Mar 24, 2017

gauge.value is not a function but setter. so correct way is
gauge.value = 10;

Could you, please, attach an example, where changing data-value attribute does not work, because I can't see any problem with that.

Thank you in advance!

@Mikhus
Copy link
Owner

Mikhus commented Mar 24, 2017

Ah, yes, got some example where problems with animation on value change exists. So it's a bug...

@Mikhus Mikhus self-assigned this Mar 24, 2017
@Mikhus Mikhus added the bug label Mar 24, 2017
@Mikhus Mikhus added this to the 2.1.3 milestone Mar 24, 2017
Mikhus added a commit that referenced this issue Mar 26, 2017
@Mikhus
Copy link
Owner

Mikhus commented Mar 26, 2017

Animation problem when updating through HTML-attribute is fixed in version 2.1.3

@Mikhus Mikhus closed this as completed Mar 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants