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

Draw icon on top of gauge but below the needle? #82

Closed
Moulde opened this issue Oct 27, 2016 · 5 comments
Closed

Draw icon on top of gauge but below the needle? #82

Moulde opened this issue Oct 27, 2016 · 5 comments
Assignees
Milestone

Comments

@Moulde
Copy link

Moulde commented Oct 27, 2016

Hi
I'm trying to recreate a gauge like this.
http://www.publicdomainpictures.net/pictures/50000/velka/fuel-gauge.jpg

So i need to draw an icon on the gauge.
I tried just getting the canvas context and drawing the icon, and it works, but after updating the value, the gauge is redrawn again, and so the image disappears.

And i am not able to draw the icon below the needle, as it needs to be drawn in the correct order.

Any ideas?
Thanks in advance.

@Mikhus
Copy link
Owner

Mikhus commented Oct 27, 2016

Hi. Thank you for contribution!

Yes, I have an idea on this - is to provide some events which will make possible to inject into gauge drawing order. Something like:

gauge.beforeDraw('needle', function(canvasContext) {
   // do some custom drawings on a given canvas
});

But this currently is not implemented, will have it as a working idea for further releases.

@Moulde
Copy link
Author

Moulde commented Oct 27, 2016

That sounds like a great way to implement it.

@Moulde Moulde closed this as completed Oct 27, 2016
@Mikhus Mikhus reopened this Oct 27, 2016
@Mikhus
Copy link
Owner

Mikhus commented Oct 27, 2016

Let's keep it open until implemented :)

@Mikhus Mikhus self-assigned this Oct 27, 2016
@Mikhus Mikhus added this to the 2.1.0 milestone Oct 27, 2016
Mikhus added a commit that referenced this issue Dec 1, 2016
@Mikhus
Copy link
Owner

Mikhus commented Dec 1, 2016

Implemented in branch 2.1.0

@Mikhus Mikhus closed this as completed Dec 1, 2016
@ashokkumarmr1
Copy link

Where and how do i call guage.before()?
I added guage.js inside asset folder

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

No branches or pull requests

3 participants