Skip to content

Commit

Permalink
minTxt & maxTxt params
Browse files Browse the repository at this point in the history
  • Loading branch information
toorshia committed Feb 11, 2016
1 parent 5bffb51 commit c0a34ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions examples/font-options.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
title: "Font Options",
value: 72,
min: 0,
minTxt: "min",
max: 100,
maxTxt: "max",
gaugeWidthScale: 0.6,
counter: true,
titleFontColor: "red",
Expand Down
8 changes: 1 addition & 7 deletions justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c0a34ec

Please sign in to comment.