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

Counter-clockwise gauges #137

Open
mainstreetmark opened this issue Jun 21, 2017 · 1 comment
Open

Counter-clockwise gauges #137

mainstreetmark opened this issue Jun 21, 2017 · 1 comment
Milestone

Comments

@mainstreetmark
Copy link

In some configurations, it would make sense to have an option for a counter-clockwise gauge. There are situations where I'd like to make a pair of "half-moon" gauges next to each other, but the one on the right needs to rotate in the opposite direction. I tried to hack it up by using (1-VALUE) and reversing the scale, but the valueBox shows 1-VALUE.

I've fiddled the example.

https://jsfiddle.net/4zyovuzk/1/

@Mikhus Mikhus added this to the TBD milestone Jun 26, 2017
@whurlston-cl
Copy link

// Counter clockwise radial gauge

// The value we want to display.
var wantedValue = 40;
// Needle will be maxValue - wantedValue
var needleValue = 100 - wantedValue;
var gauge = new RadialGauge({
renderTo: 'right',
animatedValue:true,
animation: true,
startAngle:180,
ticksAngle:135,
borders:false,
// Reverse the major tick numbers
majorTicks: ["100","80","60","40","20","0"],
highlights: [
// Reverse highlight colors.
{ from: 80, to: 100, color: 'rgba(0,255,0,.15)' },
{ from: 60, to: 80, color: 'rgba(255,255,0,.15)' },
{ from: 20, to: 60, color: 'rgba(255,30,0,.25)' },
{ from: 0, to: 20, color: 'rgba(255,0,225,.25)' }
],
value: needleValue,
// Make sure we display the wanted value in the valueBox
valueText: wantedValue.toFixed(2),
valueBoxWidth: 40
}).draw();

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