0

I would like to know how to include a text also inside the value field provided in the knob.js plugin.

https://github.com/aterrien/jQuery-Knob

I did not come across a parameter where I can include text field also inside the value. If there is a work around please help me with it.

user2409375
  • 115
  • 1
  • 12

1 Answers1

1

You can configure a 'format' hook to change the way that the text value is formatted before it gets displayed.

For example to add a percentage sign to the text you could do something like:

$(".dial").knob({
  'format' : function (value) {
     return value + '%';
  }
});

The value that gets passed in is the number, and whatever the function returns is what gets displayed.

Ben Holmes
  • 451
  • 5
  • 4