More RGraph option oddities with the Gauge chart

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 David Cook on 21st June 2017
Hi Richard:

Continuing with my Gauge Designer, I've noted a number of other oddities. This is simply using your OPTION block and handing it to RGauge (nothing in-between, no javascript - just calling RGraph.Gauge with the block with options).

First... redStart, redColor, redWidth, yellowColor, yellowWidth, greenEnd, greenColor, greenWidth.

With those set, and 'colorRanges' not set at all - no red/yellow/green areas appear. If I used 'colorRanges' instead, they do appear (however, for my use, I'd rather not use colorRanges).

Here is how I set them in my option block:

                 redStart: '90%',
                 redColor: '#00ffff',
                 redWidth: 10,
                 yellowColor: '#00ffff',
                 yellowWidth: 10,
                 greenEnd: '40%',
                 greenColor: '#00ffff',
                 greenWidth: 10,

Second... When I do: valueText: true

The value does not show up and the Title, Subtitle, Needle, and Centerpin all disappear. Here is how I am using valueText...

                 valueTextColor: '#000000',
                 valueTextBounding: '#000000',
                 valueTextBoundingStroke: '#000000',
                 valueTextBoundingFill: '#ffffff',
                 valueTextYPos: 0.5,
                 valueTextUnitPre: '',
                 valueTextUnitPost: '',
                 valueText: true,

Once again, any suggestions would help greatly!
Posted by Richard on 21st June 2017

1. You can't use percentages as the values for the color limits. The docs are perhaps a little misleading here. Use decimals instead (40% = 0.4) like this:

2. Try setting the valueTextBounding property to true instead of a color (the docs are wrong on this). And also these are missing an s.

valueTextBounding: true,
valueTextUnitsPre: 'k',
valueTextUnitsPost: '$'

I've added this to the example too.

Posted by David Cook on 21st June 2017
Hi Richard:

Thanks. The RYG color problem is now fixed. The textValue was not fixed by your suggestions, however, I discovered the problem.

In my block, I had: value: [12],

With that, no needle, centerpin, nor value is displayed.

Changing it to: value: 12,

(eg., dropping the array) fixed the problem.

Once again, Thanks.

Oh - also, on your documentation for Gauge, it is missing the 'tickmarksMedium' and 'tickmarksMediumColor' descriptions.


Add a reply

« Back to message list