Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.28.5 (build 3282) - 23 February 2024

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 drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Problem with Odometer not positioned on Rose gauge

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
freddie
Posts: 2404
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Problem with Odometer not positioned on Rose gauge

Post by freddie »

I have made some changes to my steelseries gauges.js script, found at https://www.hosiene.co.uk/weather/lib/s ... /gauges.js. The changes were mainly in the "harmless" section at the top of the script (setting some of the gauges to not display). I also made some changes to the "here there be dragons" part of the script (starting at line 2998) which includes some further variables that are updated with each poll of realtimegauges.txt, for display on another page of mine that has a limited set of gauges.

My problem is that the odometer display doesn't appear within the wind rose gauge - it appears to the left of it - and the word "undefined" is written in the gauge in place of the odometer. You can see this at https://www.hosiene.co.uk/weather/gauges.htm, and the behaviour is the same on my other page.

Are there any javascript experts out there who might point me in the direction of what is going wrong? Functionally everything works as expected, save for the odometer position.
Freddie
Image
User avatar
mcrossley
Posts: 12565
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Problem with Odometer not positioned on Rose gauge

Post by mcrossley »

Your gauges-ss.css is missing the "odo" class

Code: Select all

.odo {
  position: absolute;
  top: 67%;
  left: 50%;
  transform: translateX(-50%);
  -webkit-transform: translateX(-50%);
}
freddie
Posts: 2404
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Problem with Odometer not positioned on Rose gauge

Post by freddie »

mcrossley wrote: Thu 25 Aug 2022 8:17 am Your gauges-ss.css is missing the "odo" class
Thanks Mark - I knew you would know the answer :)

Problem is - it used to work okay before I changed the gauges.js file. The timestamp on the gauges-ss.css file was August 2018 (when I first transferred my website to that server) so I'm a bit puzzled.

I have added the class, and sure enough the odo is now positioned correctly. But I still have the word "undefined" just above the odo in the rose gauge. Any ideas?

Thanks for the help!
Freddie
Image
User avatar
mcrossley
Posts: 12565
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Problem with Odometer not positioned on Rose gauge

Post by mcrossley »

Your language js file is missing the distance entries...

Code: Select all

    miles: 'miles',
    n_miles: 'n.miles',
    km: 'km',
freddie
Posts: 2404
Joined: Wed 08 Jun 2011 11:19 am
Weather Station: Davis Vantage Pro 2 + Ecowitt
Operating System: GNU/Linux Ubuntu 22.04 LXC
Location: Alcaston, Shropshire, UK
Contact:

Re: Problem with Odometer not positioned on Rose gauge

Post by freddie »

That sorted it, thank you :)
Freddie
Image
Post Reply