Page 1 of 1

help

Posted: Sun 04 Feb 2018 9:49 pm
by dazza1223
hey i dont understand how lto to set the time on them <#RecentTS <#RecentOutsideTemp

Re: help

Posted: Mon 12 Feb 2018 7:13 pm
by mcrossley
The Wiki seems pretty clear?
... giving data values from 1 minute ago, up to 1 week ago, in 1 minute intervals.
...
For example, <#RecentOutsideTemp m=1> will give the temperature one minute ago, <#RecentOutsideTemp h=1> will give the temperature one hour ago (as will <#RecentOutsideTemp m=60>), and <#RecentOutsideTemp d=1> will give the temperature one day ago. <#RecentOutsideTemp d=1 h=1 m=1> will give the temperature one day, one hour and one minute ago. All values supplied for parameters must be whole numbers.

Re: help

Posted: Mon 12 Feb 2018 11:16 pm
by dazza1223
yh i tried it and all im getting is not the right times im setting it to

Re: help

Posted: Mon 12 Feb 2018 11:53 pm
by water01
If you posted your settings and what you are expecting it might help as at the moment no one has the slightest clue what you are trying to do.

Re: help

Posted: Tue 13 Feb 2018 12:28 am
by dazza1223
so im trying to add Sparklines line but when i hover over the chrat

i want to to show

Temp in the period 14:37 to 23:34
11.2 °C

Is there a way to show the actual time of each recent data point?

ie


[<#RecentOutsideTemp h=0 m=61>,<#RecentOutsideTemp h=0 m=56>,<#RecentOutsideTemp h=0 m=51>,<#RecentOutsideTemp h=0 m=46>,
<#RecentOutsideTemp h=0 m=41>,<#RecentOutsideTemp h=0 m=36>,<#RecentOutsideTemp h=0 m=31>,<#RecentOutsideTemp h=0 m=26>,
<#RecentOutsideTemp h=0 m=21>,<#RecentOutsideTemp h=0 m=16>,<#RecentOutsideTemp h=0 m=11>,<#RecentOutsideTemp h=0 m=6>];


i haven't got a page yet as im trying to get me heard around this

i made a temp page

http://www.davisworthing.co.uk/new/one.php

Re: help

Posted: Tue 13 Feb 2018 1:39 am
by beteljuice
As far as I can see your values ARE been populated in your code:

Code: Select all

   /* <![CDATA[ */
   $(function() {
      /* temperature sparkline() function */
      var recent_outside_temp = [5.8,5.7,5.7,5.7,
                        5.7,5.7,5.6,5.6,
                        5.6,5.6,5.6,5.6];
      $('.temperature').sparkline(recent_outside_temp, {
         type: "line",
         tooltipSuffix: " &#176;C",
         width: 60,
         tooltipChartTitle: 'Temperatures in the period<br/>12:32 to 01:27'
      });

   // Insert a second/subsequent sparkline function here

   });
   /* ]]> */
... but only 'the last man standing' is being displayed. That suggests there is something not right for the sparkline / tooltip code.

Re: help

Posted: Tue 13 Feb 2018 8:14 am
by sfws
dazza1223 wrote:Is there a way to show the actual time of each recent data point?
As Mark says, is the Wiki not clear enough?
<#RecentTS> Takes parameters like the 'recent data' web tags (e.g. <#RecentOutsideTemp>) and gives the timestamp of the data that will be returned for those web tags with the supplied parameters (it may not have the data for the exact time specified). Format can be specified in the usual way with the 'format' parameter.

Re: help

Posted: Tue 13 Feb 2018 9:59 am
by dazza1223
ok i will carry on reading lol thanks guys

Re: help

Posted: Tue 13 Feb 2018 10:38 am
by beteljuice
Afterthought - excuse the old beteljuice ignorance, but aren't sparklines some sort of graph ?
In which case no y-axis (timeline) has been defined !

Re: help

Posted: Tue 13 Feb 2018 11:13 am
by dazza1223
yh it is mate and ive seen on some one site that when u hover over it it will show u the right time not like this

tooltipChartTitle: 'Temperatures in the period<br/><#RecentTS h=0 m=61 format=hh:mm> to <#RecentTS h=0 m=6


ie

10.54
13.c
11.15
12c
12.15
9c
and so on

Re: help

Posted: Tue 13 Feb 2018 11:34 am
by jdc
To get that effect (and I have no idea if this is the 'best' way to do it) I created two sets of variables using webtags

Code: Select all

<!-- Temp -->
var temp = [2.1,1.8,1.3,1.2,1.5,2,2,2.2,2,2,2.2,2.5,2.3];
var temptime = ['05.15','05.45','06.15','06.45','07.15','07.45','08.15','08.45','09.15','09.45','10.15','10.45','11.15'];
Then I basically superimposed two graphs, one for 'temp' and one for 'time'.
The time graph is completely the background colour ('#bed8bf')

Code: Select all

$(function() {
      	   $('.temp').sparkline(temptime, {
    		type: 'line',
    		lineColor: '#bed8bf',
    		fillColor: '#bed8bf',
    		spotColor: '#bed8bf',
    		minSpotColor: '#bed8bf',
    		maxSpotColor: '#bed8bf',
			numberFormatter: function(y) {return (('0000'+(y.toFixed(2))).slice (-5));},
            width: 60,
			tooltipClassname: 'spark',
			tooltipPrefix: 'Time: ',
			tooltipFormat:'<span style="color: {{color}}"></span> {{prefix}}{{y}}{{suffix}}',
			tooltipChartTitle: 'Temperature Today.'
      });
      	$('.temp').sparkline(temp, {
			composite: true,
	        type: 'line',
    		lineColor: '#008000',
    		fillColor: '#bed8bf',
    		spotColor: '#00007f',
    		minSpotColor: '#007fff',
    		maxSpotColor: '#ff0000',
			tooltipClassname: 'spark',
			tooltipFormat:'<span style="color: {{color}}"></span>{{prefix}}{{y}}{{suffix}}',
			tooltipPrefix: 'Temp: ',
            tooltipSuffix: " &deg;C",
            width: 60
      });
   });
The Sparkline website is very helpful.
https://omnipotent.net/jquery.sparkline/#s-docs

Re: help

Posted: Tue 13 Feb 2018 12:03 pm
by dazza1223
var temptime = ['05.15','05.45','06.15','06.45','07.15','07.45','08.15','08.45','09.15','09.45','10.15','10.45','11.15'];.......... so like this yh??
[<#RecentOutsideTemp h=5 m=15>
<#RecentOutsideTemp h=5 m=45>
[<#RecentOutsideTemp h=6 m=15>
[<#RecentOutsideTemp h=6 m=45>
[<#RecentOutsideTemp h=7 m=15>
[<#RecentOutsideTemp h=7 m=45>
[<#RecentOutsideTemp h=8 m=15>

and so yh plz say im right :bash:

Re: help

Posted: Tue 13 Feb 2018 12:57 pm
by jdc
I'm using php webtags so here is a section of how I did it:

Code: Select all

$temp0	  			  ="<#RecentOutsideTemp h=0 m=0>";
$temptime0			  ="<#RecentTS h=0 m=0 format=HH.mm>";
$temp1	  			  ="<#RecentOutsideTemp h=0 m=30>";
$temptime1			  ="<#RecentTS m=30 format=HH.mm>";
$temp2	  			  ="<#RecentOutsideTemp h=1>";
$temptime2			  ="<#RecentTS h=1 format=HH.mm>";
$temp3	  			  ="<#RecentOutsideTemp h=1 m=30>";
$temptime3			  ="<#RecentTS h=1 m=30 format=HH.mm>";
$temp4	  			  ="<#RecentOutsideTemp h=2>";
$temptime4			  ="<#RecentTS h=2 format=HH.mm>";
$temp5	  			  ="<#RecentOutsideTemp h=2 m=30>";
$temptime5			  ="<#RecentTS h=2 m=30 format=HH.mm>";
HTH

Re: help

Posted: Tue 13 Feb 2018 1:01 pm
by dazza1223
ok thank u so much i will give it a try later mate and i will let u know ok !

Re: help

Posted: Wed 14 Feb 2018 10:21 am
by dazza1223
hy just want to say a big thank to u all helping me and even a bigher thank to jdc for showing me the php file and puting me on the right tracks


jdc,beteljuice,sfws,water01,mcrossley