Add support for static zones #81

Open
wants to merge 1 commit into
from

Projects

None yet

5 participants

@rsreimer
Collaborator

I have a customer who required static zones on the gauge as shown below:
gauge

I have added this feature and made it configurable with the staticZones option:

var gauge = new Gauge(canvas)
    .setOptions({
        staticZones: [
            {strokeStyle: "#30B32D", span: 2/3}, // Green
            {strokeStyle: "#FFDD00", span: 1/6}, // Yellow
            {strokeStyle: "#F03E3E", span: 1/6}  // Red
        ]});

The order of the array matters as the zones are added from left to right.
The sum of all spans should be 1.

@sondrele

Awesome, was looking after the same thing.

+1 for this

@eblancart

I was looking for that as well ! Perfect !

@bernii
Owner
bernii commented Dec 23, 2015

That's awesome. @rsreimer I've given you push access to the repo. Do you mind merging?

@kplindegaard
Collaborator

@rsreimer: I was very inspired by what you had done and used your fork in a small project together with a couple of other modifications. The net result of that is in the recent commit 364a42b.

Unfortunately and due to my lack of GitHub skills this pull request is now redundant. I propose to close this. Sorry about that, but thanks a bunch and kudos to you for your contibution.

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