Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.0.1 (build 4023) - 16 May 2024

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

Misc graphs (degree days) without values

Discussion of the Cumulusutils tool and website generator.

Moderator: HansR

Post Reply
User avatar
Dador
Posts: 234
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

Misc graphs (degree days) without values

Post by Dador »

Hi,

I noticed that the degree days charts have no values. The graph is drawn, but the numbers are missing. I've looked at other users' websites and it works fine for them, e.g. in your site Hans.

As if you'd take a look at it
https://pogodarybnik.pl/graphsmisc.htm
User avatar
HansR
Posts: 6025
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Misc graphs (degree days) without values

Post by HansR »

There is a javascript function

Code: Select all

function DayNumber2Date(dayNumber, year) {
    const date = new Date(year, 0, dayNumber);
    return date.toLocaleDateString('nl-NL');
}
which resides in cumulusutils.js.

Originally it was copied several time in each graphs file where required (two at the moment) but I moved it to cumulusutils.js to have only one entry point.

You have two options (as you create your own CUtils environment more or less):
  1. You include the function in your file where you need it as a <script>
  2. You include cumulusutils.js in your file. The advantage of this is that if I make changes you will have them automatically, the disadvantage is a performance penalty (though that may that may not be too big). I have no idea about secondary effects. If any you may have to switch back to the
    previous point.
And the nl-NL is generated automatically by CUtils but of course is your language locale.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
HansR
Posts: 6025
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Misc graphs (degree days) without values

Post by HansR »

I assume you just include graphsmisc.txt in your webpage? Do you edit this manually?

I'll have to find a better method for inclusion of this function I assume.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
Dador
Posts: 234
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

Re: Misc graphs (degree days) without values

Post by Dador »

HansR wrote: Sat 02 Sep 2023 5:36 pm You have two options (as you create your own CUtils environment more or less):
  1. You include the function in your file where you need it as a <script>
  2. You include cumulusutils.js in your file. The advantage of this is that if I make changes you will have them automatically, the disadvantage is a performance penalty (though that may that may not be too big). I have no idea about secondary effects. If any you may have to switch back to the
    previous point.
I used the second way. Works. Once again thanks for your help :) .
HansR wrote: Sat 02 Sep 2023 5:50 pm I assume you just include graphsmisc.txt in your webpage? Do you edit this manually?
I do that

Code: Select all

<?php include('graphsmisc.txt');?>
I don't know if it's professional or not. It just works and I leave it at that.
User avatar
HansR
Posts: 6025
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Misc graphs (degree days) without values

Post by HansR »

Dador wrote: Sat 02 Sep 2023 6:27 pm I used the second way. Works. Once again thanks for your help :) .
Good.
Dador wrote: Sat 02 Sep 2023 6:27 pm

Code: Select all

<?php include('graphsmisc.txt');?>
That's what I suggested originally a long time ago so I can live with that :D
It only means I have to find the solution within the graphmisc module to maintain modularity.

I'll look at it, if anything found you'll see it in the release notes.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
HansR
Posts: 6025
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Misc graphs (degree days) without values

Post by HansR »

And looking back at the code: are you generating the module graphs separately or are you generating website and using the files resulting from that?

The solution should already be there if you generate graphs (or at least it should be) and include the resulting graphsmisc.txt in which case you do not need to include cumulusutils.js

I don't think anybody used this before so it has not been verified.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
User avatar
Dador
Posts: 234
Joined: Thu 24 Nov 2011 2:22 pm
Weather Station: Davis VP2 Plus & Ecowitt
Operating System: Windows 10
Location: Rybnik, Poland
Contact:

Re: Misc graphs (degree days) without values

Post by Dador »

In fact, I've been using Extrasensors Top10 Graphs modules since it's possible. I am not generating the entire website.
User avatar
HansR
Posts: 6025
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bookworm
Location: Wagenborgen (NL)
Contact:

Re: Misc graphs (degree days) without values

Post by HansR »

Dador wrote: Sat 02 Sep 2023 8:31 pm In fact, I've been using Extrasensors Top10 Graphs modules since it's possible. I am not generating the entire website.
OK. I'll look at it again, it should work without the additional inclusion of the runtime.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
Post Reply