Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 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

Steel Gauges on a mobile

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

The PIT
Posts: 260
Joined: Thu 10 Dec 2009 6:15 pm
Weather Station: Davis VP2 Wireless
Operating System: Windows 7 32 bit
Location: England
Contact:

Steel Gauges on a mobile

Post by The PIT »

It works fairly well. However I need to move the popup graph location so they pop up centrally. If you got to http://www.sheffieldweather.co.uk/Live%20Weather.htm on a mobile (not ipad) you'll see what I mean.
Can I fix this?
Based in Sunny Old Sheffield South Yorkshire England

www.sheffieldweather.co.uk
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Steel Gauges on a mobile

Post by mcrossley »

The lines you need to change to alter the centring is...

Code: Select all

    tooltipoffsets : [20, -30], //additional x and y offset from mouse cursor for tooltips

and

        x = (x + tipw > $(document).scrollLeft() + $(window).width()) ? x - tipw - (ddimgtooltip.tooltipoffsets[0] * 2) : x;
I'd start by making the x offset 0 rather than 20, then changing "x - tipw - ..." to "x - 0 - ..."

I haven't tried it, so you may need to play around to find what works for you.
ashreigney
Posts: 29
Joined: Sun 20 Jul 2014 5:53 pm
Weather Station: N96GY
Operating System: Wndows 8
Location: ashreigney
Contact:

Re: Steel Gauges on a mobile

Post by ashreigney »

just looked on my Blackberry and it looks fine
The PIT
Posts: 260
Joined: Thu 10 Dec 2009 6:15 pm
Weather Station: Davis VP2 Wireless
Operating System: Windows 7 32 bit
Location: England
Contact:

Re: Steel Gauges on a mobile

Post by The PIT »

Only finally got around to playing with this and changes the values didn't seem to have any effect. Any other ideas?
Based in Sunny Old Sheffield South Yorkshire England

www.sheffieldweather.co.uk
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Steel Gauges on a mobile

Post by mcrossley »

The script hasn't been changed? ... (http://www.sheffieldweather.co.uk/cumul ... /gauges.js)

Code: Select all

   tooltipoffsets : [20, -30], //additional x and y offset from mouse cursor for tooltips
The PIT
Posts: 260
Joined: Thu 10 Dec 2009 6:15 pm
Weather Station: Davis VP2 Wireless
Operating System: Windows 7 32 bit
Location: England
Contact:

Re: Steel Gauges on a mobile

Post by The PIT »

That's because I put it back since it had no affect.
Based in Sunny Old Sheffield South Yorkshire England

www.sheffieldweather.co.uk
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Steel Gauges on a mobile

Post by mcrossley »

In positiontooltip, change...

Code: Select all

//        $tooltip.css({left: x, top: y});
to
        $tooltip.css({left: Math.min(Math.max(x,0),$(window).width()-tipw), top:y})
Edit: there is something odd about your page, the browser debugger shows the page and code being loaded twice? If you online edit the wrong copy in memory it doesn't show on teh page.
The PIT
Posts: 260
Joined: Thu 10 Dec 2009 6:15 pm
Weather Station: Davis VP2 Wireless
Operating System: Windows 7 32 bit
Location: England
Contact:

Re: Steel Gauges on a mobile

Post by The PIT »

how do you know it's loaded twice????

I've noticed the graphs have ceased today to update although they've been working until yesterday afternoon which is odd. The text updates but not the graphic.
Based in Sunny Old Sheffield South Yorkshire England

www.sheffieldweather.co.uk
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Steel Gauges on a mobile

Post by mcrossley »

Load the dev tools in your browser (I use Chrome) - press f12 then reload the page.
Capture.PNG
You do not have the required permissions to view the files attached to this post.
The PIT
Posts: 260
Joined: Thu 10 Dec 2009 6:15 pm
Weather Station: Davis VP2 Wireless
Operating System: Windows 7 32 bit
Location: England
Contact:

Re: Steel Gauges on a mobile

Post by The PIT »

Could be a bug in chrome as it doesn't show that in firefox.

Basically the page uses an iframe and it's shared across ipad version and a mobile phone version. If you shrink the your browser you'll see it resize automatically.

Now I've got to find why the graphs aren't updating.
Based in Sunny Old Sheffield South Yorkshire England

www.sheffieldweather.co.uk
The PIT
Posts: 260
Joined: Thu 10 Dec 2009 6:15 pm
Weather Station: Davis VP2 Wireless
Operating System: Windows 7 32 bit
Location: England
Contact:

Re: Steel Gauges on a mobile

Post by The PIT »

Just checked the page in xara it's just an iframe which refers to guages htm file. It's not loaded twice. Code below.

<iframe src="http://www.sheffieldweather.co.uk/cumulus/gauges-ss.htm"
width="100%" height="100%">
content if browser does not support
</iframe>
Based in Sunny Old Sheffield South Yorkshire England

www.sheffieldweather.co.uk
duke

Re: Steel Gauges on a mobile

Post by duke »

Am I missing something? Marks gauges resize for me just fine on what ever screen size 'out of the box'. And why use an 'iframe'?
The PIT
Posts: 260
Joined: Thu 10 Dec 2009 6:15 pm
Weather Station: Davis VP2 Wireless
Operating System: Windows 7 32 bit
Location: England
Contact:

Re: Steel Gauges on a mobile

Post by The PIT »

Yup missed a point

The only way I can keep the website layout the same across the board. Looks a bit odd when one page has a completely different look.
Based in Sunny Old Sheffield South Yorkshire England

www.sheffieldweather.co.uk
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Steel Gauges on a mobile

Post by mcrossley »

The PIT wrote:Could be a bug in chrome as it doesn't show that in firefox.
Firefox shows the same...
Capture.PNG
Can't figure out why though, could be a script pre-loading pages as it downloads the mobile page as well when you are running desktop.
You do not have the required permissions to view the files attached to this post.
The PIT
Posts: 260
Joined: Thu 10 Dec 2009 6:15 pm
Weather Station: Davis VP2 Wireless
Operating System: Windows 7 32 bit
Location: England
Contact:

Re: Steel Gauges on a mobile

Post by The PIT »

Well the only thing right now that I'm concerned about is the graphs not updating. Whats happening there???
Based in Sunny Old Sheffield South Yorkshire England

www.sheffieldweather.co.uk
Post Reply