Page 1 of 1

Highstock Temperature chart - after Beteljuice script mod

Posted: Wed 26 Feb 2020 10:34 am
by Vegit8
Hi (again)

I applied the script that was suggested in my other question (viewtopic.php?f=28&t=17825) - which seemed to go well.
Except for an oddity with the 'indoor temp' values. These seem to be picking up another value.

Transposed values are as follows..
Apparent is showing values for Dew Point
Inside is showing values for Apparent


I followed the instructions in Beteljuice's script to the letter.
Anyone else have a similar problem.

Standard TrendsT file Image Modified TrendsT Image

Cheers

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Wed 26 Feb 2020 12:32 pm
by beteljuice
Please provide a link to your site and / or page.

There are times when we get close to psychic, but it is hard work :o

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Wed 26 Feb 2020 1:19 pm
by Vegit8

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Wed 26 Feb 2020 2:59 pm
by beteljuice
What is this ?
lose_plot = [
/* example
["What", "something else"],
*/
["Temperature", "Dew Point", "Wind Chill", "Heat Index"]
<!--["Temperature", "Apparent"]-->
];
You can't use html comment in the middle of a js object !

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Wed 26 Feb 2020 3:12 pm
by Vegit8
oh... I was having problems getting the names with spaces to work, so I experimented with a single named variable. REMing out the others - didn't realise that wouldnt work.
Then flipped it the other way once I had proved just one worked.
Sorry

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Wed 26 Feb 2020 3:31 pm
by Vegit8
Its me again.

I have removed the errant row(s) from the template file and have checked the resulting page displayed on't net.

Original problem still exists ...

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Wed 26 Feb 2020 11:37 pm
by beteljuice
Oh dear .....

The beteljuice script seems to be getting confused with the sequence of things :oops:

I don't know if I can fix it as a simple 'patch' file or not :cry:

... to be continued ...

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Thu 27 Feb 2020 12:16 am
by beteljuice
Ah ....

I think I've found the problem .... ajax is loading required (series) files in a dedicated order when I am removing parts of that order.

ATM I can't see how I can compensate without (small) mods to cumuluscharts.js, which defeats the purpose of a non-intrusive 'plug-in' :bash:

I'll have a think about it .....

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Thu 27 Feb 2020 2:55 am
by beteljuice
By George I think I've beat the beggar ......

Please change:

Code: Select all

// only used for initial graph load
let observer = new MutationObserver(mutationRecords => {
	if(chart){ 
		observer.disconnect();
		rollout();
	}
});
To:

Code: Select all

// only used for initial graph load
let observer = new MutationObserver(mutationRecords => {
	if(chart.loadingShown === false){ 
		observer.disconnect();
		rollout();
	}
});
... and tell me if it works or not !!!

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Thu 27 Feb 2020 9:31 am
by Vegit8
Yay....!!! :clap:

Perfecto

Thank you for your efforts

G

Re: Highstock Temperature chart - after Beteljuice script mod

Posted: Thu 27 Feb 2020 11:57 am
by beteljuice
IMPORTANT BUG FIX 27 Feb 2020

As above, serious bug discovered and fixed.

Anybody using this should change to the new code
posted viewtopic.php?f=14&t=17684&p=138172#p136911