Hi folks,
New to quickchart/chartjs and trying to work out how to display decimal places on my radial gauge. The value I’m reporting is between 0 and 1, and so want to display the value to 2 decimal places.
Have had a look through the documentation and cannot see what construct I used to drive this.
Here’s the config I’m using from the sandbox editor.
Update: I’ve managed to work out a solution but not sure if this is the best approach. Any other suggestions welcomed.
Firstly, I tried changing the text definition to have 2 decimal places using .toFixed(2) as per this code, but whilst that added 2 decimal places, it always reported 1.00 (so it was rounding the input value to 1).
centerArea: {
text: (val) => val.toFixed(2)
},
My final workaround was to scale the data values to 100 and then use the definition of the text value to turn it back into a fraction.