Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 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

Climatology for a given day

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

Moderator: daj

User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Climatology for a given day

Post by laulau »

Hi,
I like to extract the min/max/avg temperature and other values for a particular day for all years from my database.
Could someone give me some guidance for the SQL statement i have to use to achieve it ?
Thanks
Laurent

Image
tobyspond
Posts: 252
Joined: Fri 24 Jun 2011 5:57 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Lamoine, Maine, USA

Re: Climatology for a given day

Post by tobyspond »

Is this what your are looking for?

SELECT year(logdate) as year, month(logdate) as month, day(logdate) as day, maxtemp, tmaxtemp, mintemp, tmintemp, round(avgtemp,1) as avgtemp, lowwindchill, tlowwindchill, highheatind, thighheatind, highhum, thighhum, lowhum, tlowhum, highdewpoint, thighdewpoint, lowdewpoint, tlowdewpoint, totrainfall, maxrainrate, tmaxrr, highhourrain, thighhourrain, highwindgust, thwindg, highavgwspeed, thavgwspeed, totwindrun, maxpress, tmaxpress, minpress, tminpress FROM dayfile WHERE day(logdate)=day(now()) and month(logdate)=month(now()) ORDER BY year(logdate) DESC

Kerry
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Climatology for a given day

Post by laulau »

That's it :clap:

Many thanks

Now i have to put that in a table or in graphics
Laurent

Image
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Climatology for a given day

Post by laulau »

This is what I got for now : http://meteo.laurentmey.fr/histograph/climato.php

I like to change the green columns to 'red-blue' like that :
graphique_infoclimat.fr.jpeg
from here : http://www.infoclimat.fr/climatologie/g ... 07197.html
I guess this is a' highcharts' graph but i'm not able to find how to make this kind of gradient color in a 'columnrange'.
Any help would be welcome !
You do not have the required permissions to view the files attached to this post.
Laurent

Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Climatology for a given day

Post by kocher »

Laulau

I saw your page:

http://meteo.laurentmey.fr/histograph/climato.php :clap:

I thought it was very good.

Is it possible to know the code?


Cheers
Image
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Climatology for a given day

Post by laulau »

The PHP code of the page and climato.js are directly visible :right click and view code source.
For the PHP files to read the SQL database add ?view=sce after the php filename ex :historicDayTemp.php?view=sce
Laurent

Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Climatology for a given day

Post by kocher »

Thank you very much Lau Lau :D
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Climatology for a given day

Post by kocher »

The problem that I have in "climato.php" is the code for these two lines:

<div data-Highcharts-chart = "1" id = "containerM" ........

<div data-Highcharts-chart = "1" id = "container" ........

:groan:
Image
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Climatology for a given day

Post by laulau »

Look at climato.php again; i changed it, but it is certainly not very good HTML code.
Laurent

Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Climatology for a given day

Post by kocher »

Image
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Climatology for a given day

Post by laulau »

There are no data returned by the php file that read the SQL data base http://kocher.es/cumulusMX/climato/hist ... d=16&mm=10
Laurent

Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Climatology for a given day

Post by kocher »

My mistake was in the name of the table:
"dayfile" no "Dayfile" :bash:

Thank you very much Laulau :D :clap: :clap: :clap:

http://kocher.es/cumulusMX/climato/climato.php

http://kocher.es/climograph2.php


Saludos desde San Sebastian, Spain
Image
User avatar
kocher
Posts: 233
Joined: Sat 19 Apr 2014 7:57 pm
Weather Station: Davis Vantage Pro2+
Operating System: Windows 10
Location: San Sebastian - Spain
Contact:

Re: Climatology for a given day

Post by kocher »

laulau wrote:This is what I got for now : http://meteo.laurentmey.fr/histograph/climato.php

I like to change the green columns to 'red-blue' like that :
graphique_infoclimat.fr.jpeg
from here : http://www.infoclimat.fr/climatologie/g ... 07197.html
I guess this is a' highcharts' graph but i'm not able to find how to make this kind of gradient color in a 'columnrange'.
Any help would be welcome !

The solution is this: in "climato.js"

Code: Select all

		series : [
            {
				name : 'Min-Max',
				type: 'columnrange',
				color: {
								linearGradient: { x1: 0, x2: 0, y1: 1, y1: 1.5 },
								stops: [
								[0, 'rgba(19, 114, 248, .9)'],
								[1, 'rgba(242, 70, 36, .9)']
												]
							}
			},
			{
				name : 'Media',
				type: "spline",
				color : 'lime'
			}
		]
	};

You can change the colors to your liking ;)

http://kocher.es/climograph2.php

Saludos desde San sebastian
Last edited by kocher on Fri 27 Jan 2017 10:03 am, edited 1 time in total.
Image
User avatar
laulau
Posts: 678
Joined: Tue 13 Oct 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Climatology for a given day

Post by laulau »

Thanks :D
I'll give it a try.
Laurent

Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Climatology for a given day

Post by beteljuice »

Shouldn't

linearGradient: { x1: 0, x2: 0, y1: 1, y1: 1.5 },

be ...

linearGradient: { x1: 0, x2: 0, y1: 1, y2: 1.5 },

:?:
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply