How do I set the Gauge chart scale to go from 0-4 ?

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Alejandro on 24th May 2017
Hi, I was able to happily construct my Gauges and they are working, but... I noticed an effect: I had to put the min,max values to 0 and 4 respectively, for displying values like 2.8 for example.

But the Gauges seems to always create 6 main scale divisions. So as there are 5 values in the range [0..4], the Gauge main scales are displayed as [0,1,2,2,3,4] (notice the duplicated "2") and that doesn't only look strange, of course, but also makes the needle position is acting weird.

//===== Pressure gauge =====
var pressure${customTO.taidTO.id_taid}gauge = new RGraph.Gauge({
id: 'pressure${customTO.taidTO.id_taid}',
min: 0,
max: 4,
value: 0,
options: { blabla... }

I didn't find any option in the documentation to configure the number of the main scale divisions. I am missing something?

Thanks in advance.
Posted by Richard on 24th May 2017
Hi there,

It sounds like you need to add the scaleDecimals property and set it to 1 like in this example:

Posted by Alejandro on 25th May 2017

Thanks, I tried it and work. Now I only have to decide which option looks better, if using [0,4] range with scaleDecimals:1, or just increasing range to [0,5] and adjusting the orange and red zones conveniently.


Add a reply

« Back to message list