Page 1 of 1

Problem with Odometer not positioned on Rose gauge

Posted: Wed 24 Aug 2022 5:05 pm
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.

Re: Problem with Odometer not positioned on Rose gauge

Posted: Thu 25 Aug 2022 8:17 am
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%);
}

Re: Problem with Odometer not positioned on Rose gauge

Posted: Thu 25 Aug 2022 10:50 am
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!

Re: Problem with Odometer not positioned on Rose gauge

Posted: Thu 25 Aug 2022 11:02 am
by mcrossley
Your language js file is missing the distance entries...

Code: Select all

    miles: 'miles',
    n_miles: 'n.miles',
    km: 'km',

Re: Problem with Odometer not positioned on Rose gauge

Posted: Thu 25 Aug 2022 11:13 am
by freddie
That sorted it, thank you :)