diff --git a/README.md b/README.md index 8399b31..74b5310 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ JustGage is a handy JavaScript plugin for generating and animating nice & cl ###Update log ######February 3, 2016. - * **customize display** - Custom text to min, max and value - https://github.com/toorshia/justgage/issues/193 + * **minTxt & maxTxt** - Show custom min and max text - https://github.com/toorshia/justgage/issues/193 ######January 31, 2016. * fix - https://github.com/toorshia/justgage/issues/194 diff --git a/examples/font-options.html b/examples/font-options.html index 11063c7..a2e9691 100644 --- a/examples/font-options.html +++ b/examples/font-options.html @@ -42,7 +42,9 @@ title: "Font Options", value: 72, min: 0, + minTxt: "min", max: 100, + maxTxt: "max", gaugeWidthScale: 0.6, counter: true, titleFontColor: "red", diff --git a/justgage.js b/justgage.js index cc4a20f..69e74c7 100644 --- a/justgage.js +++ b/justgage.js @@ -49,10 +49,6 @@ JustGage = function(config) { // value gauge is showing value: kvLookup('value', config, dataset, 0, 'float'), - // value: string - // customized value to show - valueTxt: kvLookup('valueTxt', config, dataset, false), - // defaults : bool // defaults parameter to use defaults: kvLookup('defaults', config, dataset, 0, false), @@ -899,9 +895,7 @@ JustGage.prototype.refresh = function(val, max) { color = getColor(val, (val - obj.config.min) / (obj.config.max - obj.config.min), obj.config.levelColors, obj.config.noGradient, obj.config.customSectors); - if (obj.config.valueTxt) { - displayVal = obj.config.valueTxt; - } else if (obj.config.textRenderer) { + if (obj.config.textRenderer) { displayVal = obj.config.textRenderer(displayVal); } else if (obj.config.humanFriendly) { displayVal = humanFriendlyNumber(displayVal, obj.config.humanFriendlyDecimal) + obj.config.symbol;