Page 1 of 2
PHP graphs using CumulusMX json data files
Posted: Sun 14 Jul 2024 9:49 pm
by broadstairs
I decided to attempt to convert my PHP based graphs which I developed years ago for Weather Display to use the json files from CumulusMX. Not all of the WD graphs will convert because so far I've not found the right data in any json files but the few I have done can be viewed at
https://www.stella-maris.org.uk/Cumulus ... test1.html this page is not linked to my main site. These are far from finished but thought I'd show what is possible with PHP and JPGraph (free version). I do intend over the next few weeks to try to convert as many more as possible and clean them up somewhat. They are not as flexible as Highcharts but at least it is an alternative.
Stuart
Re: PHP graphs using CumulusMX json data files
Posted: Thu 18 Jul 2024 4:27 pm
by broadstairs
I have now added a few more graphs to this. I am slowly adding other graphs as I find the time. The graphs for the last twelve months rainfall that were available with WD clientraw file data will require extra work to extract the data but I think most of the others can be done fairly easily - albeit slowly
Stuart
Re: PHP graphs using CumulusMX json data files
Posted: Fri 19 Jul 2024 3:02 pm
by Weerhaas
Nice work.
Yes, it will take time.
Re: PHP graphs using CumulusMX json data files
Posted: Fri 19 Jul 2024 6:00 pm
by mcrossley
I created some simple JPGraph graphs for MX years ago, I'll see if I can dig them out - they may give you a start...
Re: PHP graphs using CumulusMX json data files
Posted: Fri 19 Jul 2024 6:04 pm
by mcrossley
Ah yes! They are on github:
https://github.com/mcrossley/Cumulus-MX-Gauge-Graphs
They probably need loads of updates by now.
Re: PHP graphs using CumulusMX json data files
Posted: Fri 19 Jul 2024 9:25 pm
by broadstairs
Thanks Mark I'll take a look.
So far I've probably taken the easiest route and done the graphs where all I really needed to do was figure out which JSON files I needed to extract from and replace my clientraw data. Some others are going to need more thought. One issue I have is that my CMX data only goes back to 2022 but my WD data goes back to 2005 and so combining the data will be an issue I have for me to do things like average monthly rainfall where I need all the data to be considered!
Stuart
Re: PHP graphs using CumulusMX json data files
Posted: Sat 20 Jul 2024 9:13 am
by mcrossley
My next little project is writing some data converters. It something that has been missing in MX. C1 did have a WeatherLink convertor, but with v4 that now means potentially doing a double conversation. Steve didn't leave the source code for it though.
So I'll be starting with WeatherLink, then once a framework is in place probably WeatherCat and Weather Display. The WeatherLink convertor isn't far off the testing stage.
Re: PHP graphs using CumulusMX json data files
Posted: Sat 20 Jul 2024 9:49 am
by broadstairs
Mark that'll be great. When the time comes for WD let me know if you need some data to test with as I have years of it!
Stuart
Re: PHP graphs using CumulusMX json data files
Posted: Sat 20 Jul 2024 11:59 am
by broadstairs
Mark I have tested all your graphs and they still work with JPGraph V4.4.2 and PHP V8, except the wind rose one as they no longer support it in the free version only in the professional version!
Stuart
Re: PHP graphs using CumulusMX json data files
Posted: Sat 20 Jul 2024 12:18 pm
by mcrossley
iirc there used to be a workaround for that, from what I remember the polar chart code was included in the free version, just the call to it was missing, it was a minor edit to enable it. They may have closed that loophole since though.
Re: PHP graphs using CumulusMX json data files
Posted: Sat 20 Jul 2024 2:27 pm
by broadstairs
mcrossley wrote: ↑Sat 20 Jul 2024 12:18 pm
iirc there used to be a workaround for that, from what I remember the polar chart code was included in the free version, just the call to it was missing, it was a minor edit to enable it. They may have closed that loophole since though.
Yes the polar chart is included just not the separate WindRose one.
Stuart
Re: PHP graphs using CumulusMX json data files
Posted: Mon 22 Jul 2024 11:42 am
by wurzelmac
mcrossley wrote: ↑Sat 20 Jul 2024 9:13 am
My next little project is writing some data converters. It something that has been missing in MX. C1 did have a WeatherLink convertor, but with v4 that now means potentially doing a double conversation. Steve didn't leave the source code for it though.
So I'll be starting with WeatherLink, then once a framework is in place probably WeatherCat and Weather Display. The WeatherLink convertor isn't far off the testing stage.
Sounds very cool, I am very excited about the WeatherCat importer.

Re: PHP graphs using CumulusMX json data files
Posted: Sun 28 Jul 2024 11:42 am
by broadstairs
I have added some graphs to the original set and changed the URL sightly the new page is
https://www.stella-maris.org.uk/Cumulus ... test1.html and the old URL will no longer work. (I have edited the original URL on the first post

) These graphs need more work to clean them up and automate some more variable but work well enough to show what is possible. I intend to add more but some of the data WD used to produce is not done by CMX in JSON files so I am looking at extracting some from elsewhere but the issue is that the data is held in places which are not uploaded to the website so I will have to look at alternative ways to obtain and upload it.
Stuart
Re: PHP graphs using CumulusMX json data files
Posted: Tue 30 Jul 2024 7:49 am
by Dador
With all due respect to your work, but I can't imagine that cumulus will return to the static charts that the original version from Steve offered.
Re: PHP graphs using CumulusMX json data files
Posted: Tue 30 Jul 2024 8:15 am
by broadstairs
Dador wrote: ↑Tue 30 Jul 2024 7:49 am
With all due respect to your work, but I can't imagine that cumulus will return to the static charts that the original version from Steve offered.
I am not doing this to suggest Mark replaces Highcharts with static. I must admit I am not a fan of dynamic charts but fine for those who like them. I do wonder how much they get used by the general public on viewing weather websites. My experience of running mine since 2005 in a seaside holiday location is that mostly all folks want to see is the current conditions and a forecast for the next few days!
However for those who might like static charts or those who do not appreciate the Highcharts business practices there is an alternative and I enjoy a project. I have also discovered that there is data missing in the JSON files which I particularly like and feel it is useful even if in a static chart.
Stuart