Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.9.0 (build 3095) - 09 October 2020 (please see announcement regarding releases since 3.5.0)
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of the NOAA report and Snow Index drop-down menus to 2030)

Use this Wiki link to Download the Software (Cumulus MX / Cumulus 1 and other related items).

Changing colour of "Latest" and "Average" on Winddir gauge

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
Stuart2007
Posts: 51
Joined: Sat 22 Dec 2012 11:33 am
Weather Station: Chas Ohlson
Operating System: Windows 7
Location: United Kingdom

Changing colour of "Latest" and "Average" on Winddir gauge

Post by Stuart2007 »

I too would like to change font colours for the LCD descriptions on the WindDirection gauge see below.

I searched in vain for a response to that posting on the original version 1.0 topic (https://cumulus.hosiene.co.uk/viewtopic.php?f=21&t=5478)

...any suggestions, anyone? I presume this could be done in gauges.js

Stuart
...Trying to learn js right now...
==================
gpercival wrote:
gwheelo wrote:Mark - thanks for the code. Results here: http://www.wheelocknet.net/cumulus/gauges.html?gb.

The lines calling the fillStyle, however, did not work for me. The text color did not change. I substituted ctx.fillStyle = "rgba(0,50,255,1)"; for "Latest" and ctx.fillStyle = "rgba(255,0,0,1)"; for the "Average."

The color labels, I think, add just a bit more clarity when reading the gauge.

Thanks for all your help and the availability of the SteelSeries Gauges.

George Wheelock
George,

I like your idea of colouring the "Latest" and "Average" titles however I can't follow your discussion. I have tried both yours and Marks suggestions and neither of them seem to work. Exactly where did you add the ctx.fillStyle statements?

Geoff
http://www.rhumbline.com.au/weather

User avatar
mcrossley
Posts: 6986
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Changing colour of "Latest" and "Average" on Winddir gau

Post by mcrossley »

The simple way is to specify the initialisation parameter 'useColorLabels'
{
...
useColorLabels: true,
...
}

That will set the labels to be the same colour as the corresponding pointers, if that is suitable.

Stuart2007
Posts: 51
Joined: Sat 22 Dec 2012 11:33 am
Weather Station: Chas Ohlson
Operating System: Windows 7
Location: United Kingdom

Re: Changing colour of "Latest" and "Average" on Winddir gau

Post by Stuart2007 »

Perfect.

Should I have found it documented somewhere, Mark? I was looking at the right piece of code, should just have guessed that would be it (I was looking for a color being equalised, not just a logic switch)

Stuart

User avatar
mcrossley
Posts: 6986
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Changing colour of "Latest" and "Average" on Winddir gau

Post by mcrossley »

I errr, haven't got around to creating any documentation for the library. I guess I should look at one of the automated systems, but never find the time.

But JavaScript is so simple it's self documenting isn't it :twisted: :lol:

User avatar
gwheelo
Posts: 453
Joined: Wed 11 Jun 2008 7:36 pm
Weather Station: WMR-88
Operating System: Windows 8.1
Location: L'Estartit, Spain
Contact:

Re: Changing colour of "Latest" and "Average" on Winddir gau

Post by gwheelo »

useColorLabels: true,
goes where? file, approx. line number?

gwheelo
Image

gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Changing colour of "Latest" and "Average" on Winddir gau

Post by gemini06720 »

gwheelo wrote:goes where? file, approx. line number?
Have you even tried doing a search for the word 'useColorLabels' - the word is found only once in the script 'gauges.js'... :roll:

User avatar
gwheelo
Posts: 453
Joined: Wed 11 Jun 2008 7:36 pm
Weather Station: WMR-88
Operating System: Windows 8.1
Location: L'Estartit, Spain
Contact:

Re: Changing colour of "Latest" and "Average" on Winddir gau

Post by gwheelo »

Have you even tried doing a search for the word 'useColorLabels'
Is that ever embarrassing :oops: :bash:

I should have known better to rely on just a visual search on a file that large. Won't easily make that embarrassing mistake again - at least not publicly.

gwheelo
Image

Post Reply