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

Anatomy of Gauge #183

Open
sp33dy opened this issue Dec 6, 2019 · 3 comments
Open

Anatomy of Gauge #183

sp33dy opened this issue Dec 6, 2019 · 3 comments

Comments

@sp33dy
Copy link

sp33dy commented Dec 6, 2019

Hi,

I really love this library, THANK YOU! It's got a lot of potential for me. However, I'm struggling with the anatomy of each of the options, but I'm working through the difference between a section, area and markers for example. I don't suppose you could pop up a simple diagram of this? Although I might have figured it out by playing with it.

My second question is whether you can answer if my requirement can be met by this library?

I want to implement a cross between the dashboard and the indicator; couple with a range from -100 to 100. I want the bar to grow red when it goes negative and grow green when positive.

I see I can set ranges in the background, but I don't seem to be able to influence the bar colour as it grows left or right. Is this even possible?

Kind regards

Carl

@HanSolo
Copy link
Owner

HanSolo commented Dec 7, 2019

Hi there, you might want to check my blog for more information: https://harmoniccode.blogspot.com/search?q=Medusa&m=1
In addition there is also a Medusa Demo project on github that shows all kind gauges and in the code you can see how it was done.
For your second question I can only answer that yes you can change the color in the way you want but you might want to add a little sketch of your vision here so that I can better see what you are planning to do.

@sp33dy
Copy link
Author

sp33dy commented Dec 7, 2019

Ah, thanks for getting back to me. Had a good play last night and starting to get a hang of what it is capable of; looking at the code is useful! Thanks for the Blog, that didn't appear in my searching and I can see what I need there that will help with the Anatomy.

As for my second question:

image

A badly drawn diagram. Effectively I want to start at 0.0 and then move the needle CCW (Red) or CW (Green) and show the label for the amount.

@HanSolo
Copy link
Owner

HanSolo commented Jan 30, 2020

Sorry for the late reply but I was quite busy. So for that requirement you could either create a custom skin that only draws what you need or use areas in the standard gauge skin. There are properties to highlight a section/area when the needle is over it. With this you could create an area from -45 to 0 in red and an area from 0 to 45. If you need to always visualize the value from 0 to the current needle position in either red when negative or green when positive you should better create a new skin based on the GaugeSkin.

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