Welcome to the Cumulus Support forum.

Latest Cumulus MX release 3.7.0 (build 3089) - 28 July 2020 (please see important 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 link to Download the Software (Cumulus MX / Cumulus 1 and other related items). Software

HighCharts - lose the plot gracefully

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

Moderator: daj

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

HighCharts - lose the plot gracefully

Post by beteljuice »

graphfixPro.js V1 - IE11 bug fix and can now do translations ! - 21st March Feb 2020

Following quite a few people wanting to modify the highcharts as provided (cumuluscharts.js), the beteljuice has created a 'plug-in' for the HTML page that holds them.

This script allows you to completely remove or change the default visibility of plots
created by cumuluscharts.js.

It can now rename / translate your titles / labels / tooltips etc.

Wherever your holding page is generated is and this javascript file is where you need to edit.

It will NOT remove graphs (edit your buttons for that).
You cannot remove the 'first' plot in any graph (the beteljuice seriously can't be bothered to write code for that !)

Here's the script and a README

graphfixPro.zip
Usage:

Edit graphfixPro.js as per the README, some examples below and upload to same directory as 'charts' page.
At the bottom of the page containing the charts ADD below all the charts scripts

<script src="graphfixPro.js"></script>

Important:
Then in the same page edit ALL the 'buttons' for the graphs
so that they end with rollout();

<input name="btnTemp" class="button" style=tabindex="1" type="button" value="Temperature" onclick="changeGraph('temp'); rollout();">

EXAMPLES:-

Names are case sensitive and ENGLISH.
GRAPH name is the 'main' title at the top of the graphs.
PLOT names are the individual traces.
NB: "Temperature" GRAPH has a "Temperature" PLOT !

Code: Select all

// beteljuice plot REMOVER - cannot remove first plot of graph !!
// format: ['graph name', 'plot to lose 1', 'plot to lose 2'], NB: NO comma after last (or only) entry !

example: single graph, single plot
lose_plot = [
				["Temperature", "Inside"]
			];
			
example: single graph, muliple plots
lose_plot = [
				["Temperature", "Dew Point", "Wind Chill", "Heat Index"]
			];
			
example: multiple graphs, muliple plots
lose_plot = [
				["Temperature", "Dew Point", "Wind Chill", "Heat Index"],
				["Relative Humidity", "Indoor Humidity"]
			];


// ** A little bit more involved **
// beteljuice plot default VISIBILY - CAN hide first plot of graph 
// format: ['graph name', ['plot to show / hide 1', true],
//						  ['plot to show / hide 2', false] NB: NO comma after last plot !
//			], NB: NO comma after last graph !

example: single graph, single plot
display_plot = [
					["Temperature", ["Temperature", false]]
				];

example: single graph, multiple plots
display_plot = [
					["Temperature", ["Temperature", false], ["Wind Chill", true]]
				];

example: multiple graphs, multiple plots
display_plot = [
					["Temperature", ["Temperature", false], ["Wind Chill", true]],
					["Relative Humidity", ["Indoor Humidity", false]]
				];
That's it ....

Information on translating is in the README and the file itself.

If you've already modified the distribution copy of the cumuluscharts.js ... you're on your own :o
You do not have the required permissions to view the files attached to this post.
Last edited by beteljuice on Mon 23 Mar 2020 12:48 am, edited 11 times in total.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
HansR
Posts: 1198
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: Davis Vantage Pro 2+
Operating System: Raspbian GNU/Linux 10 (Buster)
Location: Wagenborgen (NL)
Contact:

Re: HighCharts - lose the plot gracefully

Post by HansR »

Ah, nice. I'm gonna try this.... Thnx. :) :clap:
https://meteo-wagenborgen.nl / Cumulus 3.6.8 (build: 3084)
Davis Vantage Pro 2+ / Raspberry Pi 3 Model B Plus Rev 1.3
Raspbian Linux 10 (buster) / 4.19.118-v7+ armv7l
Mono JIT compiler version 6.8.0.123 (tarball Tue May 12 15:31:43 UTC 2020)

User avatar
HansR
Posts: 1198
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: Davis Vantage Pro 2+
Operating System: Raspbian GNU/Linux 10 (Buster)
Location: Wagenborgen (NL)
Contact:

Re: HighCharts - lose the plot gracefully

Post by HansR »

@beteljuice: so I implemented the thing and it works... partially. It works in the sense that the series are deactivated (for Temperature). But as a user (as viewer of the webpage) I can still enable the series and view them.

For the series 'Relative Humidity' it does not seem to work at all (the title is: title: {text: 'Relative Humidity'} ) and the series is name: 'Indoor Humidity'). so I entered in the wxgraphs.php file:

Code: Select all

lose_plot = [
			["Temperature", "Inside", "Apparent"]
			["Relative Humidity", "Indoor Humidity"]
		];
and it still shows the indoor humidity.

So, in summary I have the following observations:
1) The series do not really disappear, they are made invisible (but the user can make it still visible)
2) It does not work for Relative Humidity (maybe the two word title?)
https://meteo-wagenborgen.nl / Cumulus 3.6.8 (build: 3084)
Davis Vantage Pro 2+ / Raspberry Pi 3 Model B Plus Rev 1.3
Raspbian Linux 10 (buster) / 4.19.118-v7+ armv7l
Mono JIT compiler version 6.8.0.123 (tarball Tue May 12 15:31:43 UTC 2020)

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

Re: HighCharts - lose the plot gracefully

Post by beteljuice »

1) The series do not really disappear, they are made invisible (but the user can make it still visible)
If they are invisible (and no legend) how can they be activated ?

but ... that may be because ...
2) It does not work for Relative Humidity (maybe the two word title?)

Code: Select all

lose_plot = [
			["Temperature", "Inside", "Apparent"]
			["Relative Humidity", "Indoor Humidity"]
		];
read again:

Code: Select all

// format: ['graph name', 'plot to lose 1', 'plot to lose 2'], NB: NO comma after last entry !
lose_plot = [
/* example
			["What", "something else"],
*/
			["Temperature", "Inside", "Apparent"]
		];
You need a comma after your first (Temperature) array ;)
Last edited by beteljuice on Fri 29 Nov 2019 10:02 am, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
HansR
Posts: 1198
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: Davis Vantage Pro 2+
Operating System: Raspbian GNU/Linux 10 (Buster)
Location: Wagenborgen (NL)
Contact:

Re: HighCharts - lose the plot gracefully

Post by HansR »

Ah, temperature now indeed works. :oops:
But alas, not the humidity graph. :roll:

And I did check and double checked spelling (title text and naming of the series), actually I used cut and paste but inside humidity stays visible.
https://meteo-wagenborgen.nl / Cumulus 3.6.8 (build: 3084)
Davis Vantage Pro 2+ / Raspberry Pi 3 Model B Plus Rev 1.3
Raspbian Linux 10 (buster) / 4.19.118-v7+ armv7l
Mono JIT compiler version 6.8.0.123 (tarball Tue May 12 15:31:43 UTC 2020)

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

Re: HighCharts - lose the plot gracefully

Post by beteljuice »

Ah ... logic error by the beteljuice :oops:

Fixed in first post ...
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
HansR
Posts: 1198
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: Davis Vantage Pro 2+
Operating System: Raspbian GNU/Linux 10 (Buster)
Location: Wagenborgen (NL)
Contact:

Re: HighCharts - lose the plot gracefully

Post by HansR »

Ah... OK. Works great now.
https://meteo-wagenborgen.nl / Cumulus 3.6.8 (build: 3084)
Davis Vantage Pro 2+ / Raspberry Pi 3 Model B Plus Rev 1.3
Raspbian Linux 10 (buster) / 4.19.118-v7+ armv7l
Mono JIT compiler version 6.8.0.123 (tarball Tue May 12 15:31:43 UTC 2020)

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

Re: HighCharts - lose the plot gracefully

Post by beteljuice »

V2 - IMPORTANT bug fix - 27 Feb 2020

Errors through dynamic data loading discovered / resolved.

Please use NEW version (In first post)
Image
......................Imagine, what you will KNOW tomorrow !

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

Re: HighCharts - lose the plot gracefully

Post by beteljuice »

Version 2.1 27 Feb 2020

:groan: Should've known it was too good to be true ...
Needed the mutation observer to fire up on new graph load as well as initial chart load.
Image
......................Imagine, what you will KNOW tomorrow !

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

Extra facility ?

Post by beteljuice »

No ... Not a bug fix :lol:

Comment has been made that a user not only wants to REMOVE some plots, but also change default VISIBILITY.

I'm pretty confident I can expand the script to accommodate this if there is an interest ...
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
HansR
Posts: 1198
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: Davis Vantage Pro 2+
Operating System: Raspbian GNU/Linux 10 (Buster)
Location: Wagenborgen (NL)
Contact:

Re: HighCharts - lose the plot gracefully

Post by HansR »

Yes, that would be nice.
https://meteo-wagenborgen.nl / Cumulus 3.6.8 (build: 3084)
Davis Vantage Pro 2+ / Raspberry Pi 3 Model B Plus Rev 1.3
Raspbian Linux 10 (buster) / 4.19.118-v7+ armv7l
Mono JIT compiler version 6.8.0.123 (tarball Tue May 12 15:31:43 UTC 2020)

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

Re: HighCharts - lose the plot gracefully

Post by beteljuice »

V4 -Improved functionality - 29th Feb 2020

The script now allows you to completely remove or change the default visibility of plots
created by cumuluscharts.js.
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
HansR
Posts: 1198
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: Davis Vantage Pro 2+
Operating System: Raspbian GNU/Linux 10 (Buster)
Location: Wagenborgen (NL)
Contact:

Re: HighCharts - lose the plot gracefully

Post by HansR »

Works great. 8-) :!:
https://meteo-wagenborgen.nl / Cumulus 3.6.8 (build: 3084)
Davis Vantage Pro 2+ / Raspberry Pi 3 Model B Plus Rev 1.3
Raspbian Linux 10 (buster) / 4.19.118-v7+ armv7l
Mono JIT compiler version 6.8.0.123 (tarball Tue May 12 15:31:43 UTC 2020)

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

lose the plot gracefully - UPDATE

Post by beteljuice »

Hello Dear Readers ..

IE11 bug fix
NEW - can do translations !

New graphfixPro.js file from first post ...
Image
......................Imagine, what you will KNOW tomorrow !

Post Reply