Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.8.4 (build 3094) - 14 September 2020 (please see announcement regarding releases since 3.5.0)
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 the NOAA report and Snow Index drop-down menus to 2030)

Use this Wiki link to Download the Software (Cumulus MX / Cumulus 1 and other related items).

Highcharts graphs hi-low data & month title problem

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

Moderator: daj

Post Reply
mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Highcharts graphs hi-low data & month title problem

Post by mm23 »

Hello everybody....I need help
On my web page http://vrijemeusibeniku.com/povijesni-prikaz /TEMPERATURA/Ekstremi, data and month titles on X axis does not match...

Month' s titles below the x axis are arranged o.k (considering the beginning of the measurement in November 2014) .... Stu (2014)., Pro (2014)., Sij (2015)., Velj (2015)., Ozu (2015) ...... or on English…… Nov (2014). , Dec., Jan (2015)., Feb., March……but the data are arranged chronologically by month (Jan, Feb, March….), but not in "real" chronological order considering the measurment start, starting from January (2015), February (2015) , March (2015), November (2014), December (2014). I solved this problem when it first came out, but when the next month completed, it all comes back again like it is now.
In short that means that where below the x-axis wrote November, are displayed data for January.....etc

Somebody please help….. or I just have to wait until one (first) year of the measurements finished


All of the above refers to data for temperature (Temperatura) and wind (Vjetar)

Thanks!
Image

User avatar
mcrossley
Posts: 6922
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts graphs hi-low data & month title problem

Post by mcrossley »

I'm not sure I follow. It looks OK to me.

The y-axis is showing the months in the correct order: Jan -> Dec (Sij -> Pro)

You only have data for Nov (2014), Dec, Jan, Feb Mar. And that is being plotted against the correct months, the last two columns and the first three.

Perhaps the name is confusing, I called it 'by year', it would be better called 'by month'.

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: Highcharts graphs hi-low data & month title problem

Post by mm23 »

....hard to explain....
If you look at the data for last month Ozu. (March), the minimum temperature was -4. 6 .... actually it's data for December http://vrijemeusibeniku.com/tablica-noa ... 2014&mo=12

Thanks!
Image

User avatar
mcrossley
Posts: 6922
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts graphs hi-low data & month title problem

Post by mcrossley »

Ah, sorry, I was looking at the wrong graph :oops:

You are correct, the SQL select statement will not work with the graph until you have a full years worth of data.

In order to fix that I think you would have to create a temporary table with twelve rows - one for each month and left join the dayfile table to it.
Or, you could do a join against some unions like this...

Code: Select all

SELECT MAX(d.MaxTemp), MIN(d.MinTemp), ROUND(AVG(d.MaxTemp), 1), ROUND(AVG(d.MinTemp), 1)
FROM (
	SELECT 1 AS MONTH
	UNION SELECT 2
	UNION SELECT 3
	UNION SELECT 4
	UNION SELECT 5
	UNION SELECT 6
	UNION SELECT 7
	UNION SELECT 8
	UNION SELECT 9
	UNION SELECT 10
	UNION SELECT 11
	UNION SELECT 12
) AS m
LEFT JOIN daydata d
ON date_format(d.logdate, '%c') = m.month
GROUP BY m.month
Your problem then would be how HighCharts would cope with null values for the missing months
Last edited by mcrossley on Mon 23 Mar 2015 9:59 pm, edited 1 time in total.

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: Highcharts graphs hi-low data & month title problem

Post by mm23 »

Many thanks Mark for your help and quick response.
I'll see what I can do about this issue.....
Image

User avatar
mcrossley
Posts: 6922
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts graphs hi-low data & month title problem

Post by mcrossley »

I just tested adding null values as both text "null" and straight reference null to a bar graph, and HighCharts coped fine, it didn't plot anything for those series with null, and plotted the two valid values in the last two columns.

Look at the 1800 plot inthis JSFiddle

User avatar
mcrossley
Posts: 6922
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts graphs hi-low data & month title problem

Post by mcrossley »

Actually, I fixed this a better way, the temperature and wind hi/lo PHP scripts have been updated on my site to cope with tables that only have partial year data. It makes to response slightly larger, but means they should now work for everyone.

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: Highcharts graphs hi-low data & month title problem

Post by mm23 »

Is there any chance that I "borrow" these scripts or I'll have to "handle" on any other way :arrow: ;) .....

Anyway, thanks a lot again......
Image

User avatar
mcrossley
Posts: 6922
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts graphs hi-low data & month title problem

Post by mcrossley »

Sure, you can view the source and copy them to your site.

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: Highcharts graphs hi-low data & month title problem

Post by mm23 »

....you talking 'bout historicTemperatureYearly and historicWindYearly ?
Image

User avatar
mcrossley
Posts: 6922
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts graphs hi-low data & month title problem

Post by mcrossley »

Nope, I thought the problem was with historicTemperatureHiLo.php and the corresponding wind version?

mm23
Posts: 152
Joined: Mon 03 Feb 2014 12:22 pm
Weather Station: ws 2350
Operating System: windows xp sp3
Location: Europe

Re: Highcharts graphs hi-low data & month title problem

Post by mm23 »

Yes, Mark sorry.....you are right. I messed up with the script name.......
Image

User avatar
mcrossley
Posts: 6922
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Buster Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Highcharts graphs hi-low data & month title problem

Post by mcrossley »

Let me know if the updates do fix the problem for you.

Post Reply