Fuel Gauge - the options scaleVisible, labelsCount, labelsEmpty

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 Robert on 30th January 2016
Hello Again,

I'm attempting to reset the scale of the Fuel Gauge.
Instead of it being sectioned into 5ths, I would prefer it being sectioned into 8ths.

I read the docs, but am failing to understand what is probably obvious and trivial. Nonetheless, it isn't working for me.



Here's my code:

RGraph.Reset(cvs1);
  var Gas = [12.5,25,37.5,50,62.5,75,87.5];
  var a = Gas[rand(0,6)];
         var fuel = new RGraph.Fuel({
         id: 'cvs1',
  scaleVisible: true,
  labelsEmpty: 'Empty',
  labelsCount: 9,
         min: 0,
         max: 100,
         value: a,
     }).draw();



Thank you so much,
Robert
__________________

Not really part of the above problem but, when I redrew the fuel gauge, the "needle" would not clear, but draw another needle. Thus the "RGraph.Reset(cvs1)

Posted by Richard on 30th January 2016
Hi,

There isn't a lot of options for the Fuel Gauge, but to get 8 labels you can do this:

www.rgraph.net/fiddle/view.html/a-fuel-chart-with-a-scale


Richard
Posted by Robert on 31st January 2016
Yes Sir, that worked.

I need to remember the "options" idea:

    options: {
      stuff,
      stuff
      }


Thanks again Richard.

Add a reply




« Back to message list