Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

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

Legacy Cumulus 1 release 1.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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Resize Cumulus graphs for web page?

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
duke

Resize Cumulus graphs for web page?

Post by duke »

As probably most of you have read I am gradually working through my 1st ( :? ) php website.

To make it "appear" complete while I work on other pages I thought I would "borrow" the code from the Cumulus graphs & trends pages for my own page but they appear way too big. How do I scale them down?

http://www.nightingaleweather.co.uk/graphs.php

Duke
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Resize Cumulus graphs for web page?

Post by mcrossley »

I think you would be best using a combination of two techniques. Firstly the large graphs, iirc Cumulus has an option to rescale them on the Internet settings page, but this does not affect the thumbnails.

The thumbnails you can rescale client side by just specifying the image width/height in the <IMG> tag - you can do this for the main graphs as well of course.

there are options of using PHP to rescale the images if you wish to research that.
duke

Re: Resize Cumulus graphs for web page?

Post by duke »

Thanks. Worked perfectly.
TNETWeather

Re: Resize Cumulus graphs for web page?

Post by TNETWeather »

In that you are using XHTML as your document type, you should learn to use CSS to control your elements instead of using width and height in your img tags since those really are not proper.

In your CSS: you could define a class like:

Code: Select all

.graphimg { width: 174px; height: 54px; }
then when you use HTML code to define your images you can use the class info.

Instead of:

Code: Select all

<img src="thermometer.php" 
    height="170" width="54"
    alt="Current temperature, daily max/min"
    title="Current temperature, daily max/min" />
Use:

Code: Select all

<img class="graphimg" src="thermometer.php"  
    alt="Current temperature, daily max/min"
    title="Current temperature, daily max/min" />
Along with CSS being the proper way to do this when using the doc type you are using for your pages, it also makes making adjustments much much easier in the future. You can now change the size used for those images on the fly by simply making one edit to your CSS and they all will adjust.

So a change of:

Code: Select all

.graphimg { width: 150px; height: 50px; }
Would change what the browsers use for sizing for all the images that have that CSS tag referenced in them.
duke

Re: Resize Cumulus graphs for web page?

Post by duke »

I know this is an old post but rather than start a new topic, what is the "standard" size that Cumulus uploads the graph image at? There seems to be a lot of people resizing with the most common sizes being 750px x 300px and 923px x 369px which seems an odd size :?
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Resize Cumulus graphs for web page?

Post by steve »

The large graphs are 750x300 and the thumbnails are 150x100.
Steve
duke

Re: Resize Cumulus graphs for web page?

Post by duke »

Ok, thanks Steve, that is what I thought. But, strangely, the Cumulus that I have just installed (a few minutes ago) on my local server is producing graphs of 923px x 369px. It is a fresh install on a fresh drive without any alterations to Cumulus. Not even a PWS connected.

EDIT: and for my smaller images I am getting 185px x 123px :?
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Resize Cumulus graphs for web page?

Post by steve »

Sorry, I don't know. On both of my PCs, running different version of Windows at different resolutions, I get images at the intended default size.
Steve
Post Reply