Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

If value option is greater than max option custom sector coloring reverts to default red hex color. #194

Closed
makeitaboldmove opened this issue Jan 30, 2016 · 2 comments

Comments

@makeitaboldmove
Copy link

And for display purposes we cannot get away with making the value and max equal because of the way we are using this library (see below).

Image

Here's the generated JavaScript behind the one with 132%. The gauge fill should be green.

var gauge_one = new JustGage({

    id : "gauge_one",
    value : 15176,
    min : 0,
    max : 11521,
    title : "2015 Pump Bookings",
    label : "$15,176",
    textRenderer : function() {
        return "132%"
    },

    titleFontColor : "#141414",
    titleFontFamily : "GTPressuraWeb",
    titlePosition : "below",
    titleFontColor : "#141414",
    valueFontFamily : "Open Sans",
    valueMinFontSize : 14,
    titleMinFontSize : 14,
    labelMinFontSize : 14,
    minLabelMinFontSize : 14,
    maxLabelMinFontSize : 14,

    hideInnerShadow : true,
    levelColorsGradient : false,
    counter : true,

    customSectors : [{
        color : "#e6281e",
        lo : 0,
        hi : 8526,
    }, {
        color : "#f6f400",
        lo : 8527,
        hi : 11520,
    }, {
        color : "#94d61c",
        lo : 11521,
        hi : 15177,
    }],
});

Any thought on this would be appreciated. Thank you.

@toorshia
Copy link
Owner

I think there's a bug in getColor(). Whenever you set value to match lo value for the sector, it returns red. Let me do some fixing...

@toorshia
Copy link
Owner

Fixed. Check http://justgage.com/issues/194.html, and get latest commit. Thanks for the heads-up!

toorshia added a commit that referenced this issue Jan 31, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants