Page 1 of 1

Graph Combined

Posted: Thu Feb 01, 2018 8:15 am
by meteoesine
Great block! really that was missing.
Ingenious the possibility to set the block height. Would be great if there is the possibility to extend it to all existant blocks to have the homepage more tidy...

just one question: in this block is it possible to have the main setting font type?
thanks in advance

ScreenShot00222.jpg
ScreenShot00222.jpg (99.99 KiB) Viewed 31936 times

Re: Graph Combined

Posted: Thu Feb 01, 2018 9:21 am
by Jachym
I think this one is more legible, but you can change this in the Block HTML where the Highcharts part is.

Re: Graph Combined

Posted: Fri Feb 02, 2018 10:13 pm
by Dehatter
Any chance to get Pressure added to the list? If I enter "P" the block reserves space for it, but the graph is not drawn.

Tom

Re: Graph Combined

Posted: Sat Feb 03, 2018 7:06 am
by meteoesine
Hi,
Yes, I agree with Tom about pressure graph;

I noticed the quantity of rain does not reset at the beginning of the next day,
furthermore, the rain quantity value above 27mm shows infinite decimals
thanks for any comments
have a nice weekend
ScreenShot00224.jpg
ScreenShot00224.jpg (29 KiB) Viewed 31886 times

Re: Graph Combined

Posted: Sat Feb 03, 2018 10:16 am
by MeteoTwischkamp
Hi,

Have the problem with the rain not being reset at midnight as well. Apart from that issue a very useful addition to the template, especially for people who don't want to read just "naked numbers". :)
I have it on the mobile page for that reason as well.

And i also agree with Tom and Norbert about the missing pressure graph.

BR

Georg

Re: Graph Combined

Posted: Sat Feb 03, 2018 3:33 pm
by meteoesine
Hi Jachym,
Very appreciated the update to v2.0 but any chance to have the reset rain value at midnight?
Thanks in advance

Re: Graph Combined

Posted: Sat Feb 03, 2018 3:45 pm
by Jachym
Hi,
this needs to be fixed in the db, the graph shows what is in the database, if I only change this in the one block it will be incorrect elsewhere. The graph shows cumulation over the period shown, this is how I inteded it to be, i dont want it to be reset in the graph every midnight, that would not show the total rain clearly

Re: Graph Combined

Posted: Sat Feb 03, 2018 6:23 pm
by Semtex
Hi

In the next update
It is possible to change the colors the same as interactive graph ??

Re: Graph Combined

Posted: Sat Feb 03, 2018 8:41 pm
by Jachym
Hi,
Im not a fan of changing colors. There are several reasons. First, it is current trend to use simple BW colors, no fancy rainbows, animated GIFs etc. the page looks much more professional, trust me.
Second, more importantly, using black/white is the ONLY way to guarantee good visibility for all color themes. Users can change themes themselves for themselves via cookies so even if you know that on your page a particular color works, it might not work well when a user changes theme.
That said you are of course free to change it in the HTML, it is not difficult, it is in the highcharts section as simply "color" in the series element

Re: Graph Combined

Posted: Sun Feb 04, 2018 11:02 pm
by N0BGS
Nice work on this one, Jachym Thank you.

I found that the chart displays UTC time on the baseline, but local time on hover.
Personally, I find that a bit confusing so I made a very simple change to graphCombinedBlock.php.

I simply changed line 168 from "true" to "false:" :)

Code: Select all

164 // Apply the theme
165	Highcharts.setOptions(Highcharts.theme);
166	Highcharts.setOptions({
167		global: {
168			useUTC: false,
169			timezoneOffset: <?php echo $offset?>
I would have thought line 169 would do that automatically (??) the value returned for $offset is 300 which is correct for my location. Maybe I have something mis-configured elsewhere.

Anyway, thought I'd share this since it is a very simple modification.

--Kurt

Re: Graph Combined

Posted: Mon Feb 05, 2018 6:52 am
by Jachym
See my last reply here: viewtopic.php?f=56&t=675

Re: Graph Combined

Posted: Sun Feb 11, 2018 9:07 pm
by Dehatter
Small issue I just noticed. There needs to be a limit on the number of decimal points shown. I am sure it is something to do with rounding, but when all those decimals show up, it makes it difficult to read. See the attached photo.

Tom

Re: Graph Combined

Posted: Mon Feb 12, 2018 4:52 am
by Jachym
This is a problem with Javascript and way it handles numbers. The number is sent rounded, but it still creates this mess - sometimes. Even the "toFixed" function didnt help. I suspect they must have done something inside the Highcharts code that causes this because it always happens just with highcharts

Does it happen for all values or just "some"?

Re: Graph Combined

Posted: Mon Feb 12, 2018 6:27 am
by Dehatter
Thank you for the response.

Tom

Re: Graph Combined

Posted: Fri Mar 30, 2018 12:20 am
by mchd17
Is there any way to remove the "date"? i am using block as for TODAY only. IT would look better on mobile page without the date, just data and time. Ideas? Or not possible?

mchd17

Re: Graph Combined

Posted: Sat Mar 31, 2018 6:05 am
by Jachym
Hi,
the date auto adjusts to the local date/time format

formatter: function() {
var d = new Date(this.x);
var n = d.toLocaleString();
return '<b>'+this.y +'</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + n;
},

it is the d.toLocaleString().

You could convert this to a normal date using the JS commands such as d.getHour() etc. Then insert it on the "return" line insted of the "n" at the end

Re: Graph Combined

Posted: Sat Mar 31, 2018 6:28 pm
by mchd17
:D :D I am trying and learning a bit. You have to remember, this is just a hobby. I replaced with this code

var h = d.getHours();
var m = d.getMinutes();
return '<b>'+this.y +'</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + h + ":" + m;

Works but shows 24 hour time. hmmmmm......now how can i switch to am/pm time. I think that might be over my head, lol. Been trying a few things, but it messes up on the graphs.

Re: Graph Combined

Posted: Sun Apr 01, 2018 4:55 pm
by Jachym
try something like

var ampm = "am";
if(h>12){
ampm = "pm";
h = h - 12;
}
and then output the ampm parameter as well

Re: Graph Combined

Posted: Mon Apr 02, 2018 2:30 pm
by mchd17
Thanks Jachym, that did the trick

mchd17