creating Gauge using jsGauge

1k Views Asked by At

i am creating a gauge using jsGauge

the answers in this link Create a gauge using jsgauge has helped me but i am trying to make a gauge that can display percentage for example 55.57%.

as shown on jsgauge plugin page http://code.google.com/p/jsgauge/ the fourth gauge shows the value 10.55. is it possible using jsgauge and the examples shown in the answers if yes how can it be done.

1

There are 1 best solutions below

2
On BEST ANSWER

You can use the valueFormat option for this. For example:

 valueFormat: function (value, decimals) {
                  return value.toFixed(decimals) + '%';
              }

There is also a decimals option that you may need to specify to ensure the proper number of decimal places:

options = {
    ...
    decimals: 2,
    ...
 }

Does that help?