cloudy

Author Topic: Sparkline  (Read 22184 times)

0 Members and 1 Guest are viewing this topic.

Bashy

  • Guest
Re: Sparkline
« Reply #90 on: November 07, 2007, 10:38:02 PM »
Well i have used the correct station name that is in the Real Time clientraw upload for the Client
viewer/AVG/WDL setup
screen and now i dont get the error email :)

Offline edje1205

  • edje
  • Posts: 1,838
  • Zaandam Holland, the Netherlands
    • http://www.weersverwachtingen.eu
Re: Sparkline
« Reply #91 on: November 07, 2007, 10:52:30 PM »


good for you  :D




bedtime here !
Ed
Woodenshoes,mills,hightech;but random weather
www.weersverwachtingen.eu
P4 2,2Ghz-2GB RAM-Win2K-Broadb.connect


Bashy

  • Guest
Re: Sparkline
« Reply #92 on: November 08, 2007, 08:14:14 AM »
My last statement was not entirely correct lol

I woke up this morning to finad about 15 emails from the cron daemon saying
about that line 17, So i set it up so that command wont be spamming me any more :)

Offline pinto

  • Posts: 766
  • Belgium
    • weather station Kampenhout
Re: Sparkline
« Reply #93 on: November 08, 2007, 08:29:57 AM »
there are no values to update, did you set to rename the clientraw.txt file in Weather Display
I think the script is reading the clientraw-file while it is written to your server

Jozef

Bashy

  • Guest
Re: Sparkline
« Reply #94 on: November 08, 2007, 08:47:08 AM »
Hi

I aint set it to be renamed its just as is..
I dont know how the script works but it is working and recording data to the database
and thats fine by me, thats all i wanted, if it wants to send an email error, i dont mind that
cause i can suppress the emails anyway...

The main thing is its recording data into the database.

Before i forget, there was an error when importing the table into the database.
It said sommat about sommat being too long, but as everything was there i
just ignored it :) a;sp as the table is nothing to do with your script (well not directly)
 i didnt mention it

But like i said, its working m8 and thats fine by me, thanks again :)

Offline edje1205

  • edje
  • Posts: 1,838
  • Zaandam Holland, the Netherlands
    • http://www.weersverwachtingen.eu
Re: Sparkline
« Reply #95 on: November 08, 2007, 09:38:36 AM »
Code: [Select]
<P>Error performing query: <br> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
 , , , , ,
  , , , , ,
   , , , , ,
    , , , ,
     , , ,
      , , , ,' at line 17</P>

what does it mean anyway ? line 17 at the script is mystation name, but removed/disabled it !
Ed
Woodenshoes,mills,hightech;but random weather
www.weersverwachtingen.eu
P4 2,2Ghz-2GB RAM-Win2K-Broadb.connect


Online TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Global Moderator
  • Posts: 5,865
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: Sparkline
« Reply #96 on: November 18, 2007, 05:28:04 AM »
I'm playing with an all in one PHP script that generates a sparkline based on what you pass to it.

It supports all the possible values from the Clientrawhour.txt file except Wind Direction.  So it will do rain, temp, baro, hum, winds, windg (those are the exact arguments it needs).

It also can output in U (US) or M (Metric) formats.
If no options are passed to it, it assumes a default of temp with US °F values.

You tell it what type of chart by adding the URL   charts=temp  (for Temp)...  and  unit=M  (for Metric)

Arguments can be in any order using normal URL conventions.

Some URL Examples are below:

Metric - Baro

    http://www.TNETWeather.com/sparkline/wdsparkline.php?chart=baro&unit=M
   
Humidity (there is no US or Metric difference)
   
    http://www.TNETWeather.com/sparkline/wdsparkline.php?chart=hum

Temp - °F

    http://www.TNETWeather.com/sparkline/wdsparkline.php?chart=temp&unit=U

WindSpeed - kts

    http://www.tnetweather.com/sparkline/wdsparkline.php?chart=windg&unit=M

Of course the data is coming from my site which has had no Rain so that will be flat lined.  I noticed that we are not having any wind tonight as well, just checked the signal levels and they are 98%... pretty typical for around here.

I am working out some security issues but I think I can also have it obtain data from a remote site's clientrawhour.txt file as well.  So it could be used for both local site and a remote site.

The Script is based on Pinto's originally posted script but uses my included Settings, Clientraw and Weather-Math files which I will release at the same time.

The script makes it easy to change the labels and colors for each chart with settings at the top like:

// Set values for Temp
if ($chart_type == 'TEMP' ) {
    $chart_sval = 181;
    $chart_eval = 240;
    $chart_title = 'Temp Last 60 Minutes';
    $chart_text = 'green';
    $chart_line = 'green';
    $chart_min  = 'blue';
    $chart_max  = 'red';
    $chart_back = '#E0E0E0';
    if ($chart_unit != 'U' ) {
        $chart_title .= " - °C";
    } else {
        $chart_title .= " - °F";
    }   
}


It will also work with the PHP CLI interface with the options being Arguments instead so you can run it from Crontab and have it output the file to a file instead.

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Online TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Global Moderator
  • Posts: 5,865
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: Sparkline
« Reply #97 on: November 18, 2007, 05:52:22 AM »

The remote access is working pretty good....

Here is www.gateway2capecod.com's wind speed, wind gust, temp, baro etc..


All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline jmcmurry

  • Jim McMurry
  • Posts: 2,336
  • Mauston, WI, USA
    • Juneau County Weather
Re: Sparkline
« Reply #98 on: November 18, 2007, 10:19:37 AM »
Very nice Kevin.  - Jim

 Home of NSLog NexStorm Lightning Data Manager

Offline BfdWx

  • Posts: 1,586
  • Branford Connecticut
    • Branford Weather
Re: Sparkline
« Reply #99 on: November 18, 2007, 01:41:33 PM »
Look nice Kevin, it took me hours to figure out how to do the conversions #-o #-o Will you be able to pick the colors of the text etc?   I'm sure this will help a lot of people.

Thanks,

Jack

Offline gateway2capecod

  • Posts: 1,813
  • Middleborough, Ma. USA
    • Middleborough, Ma. Weather
Re: Sparkline
« Reply #100 on: November 18, 2007, 02:37:58 PM »
Hello and good morning....

I got the Temp converted to Fareinheit, and the rest are all now working on my home page currently, although I have not added any for winds yet, just the 4 default ones that came with the Sparkline Zip folder. (Temp, Hum, Rain, Baro)

One question I also had was this.: In each grapgh is a green Numerical value, which must be for what the reading was 60 minutes ago, and then there is also a Red & Blue Numercal value, BUT These are usually the same reading and I wondered why there is 2, both a red and a blue reading? and what exatly do they mean?
wouldnt the grapgh look better with just one numerical value at the begining and one at the ending of the grapgh? or Am I missing something? In the rain.php I only see 2, but it is because I havent any rain in past 24 hours.

Thanks Kevin for making/working on this Newer Improved Version and will wait for it's release. One Question though I have is why would someone need to get the data from a different source, other than their own clientrawhour.txt? (remote source)


going to drink some more coffee...Chris

Online TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Global Moderator
  • Posts: 5,865
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: Sparkline
« Reply #101 on: November 18, 2007, 03:59:27 PM »
Thanks Kevin for making/working on this Newer Improved Version and will wait for it's release. One Question though I have is why would someone need to get the data from a different source, other than their own clientrawhour.txt? (remote source)

You have to think outside the box sometimes....

Remotely Sourcing the data...
  • You belong to a weather network (Like I belong to  SouthWestern Weather Network) and want to use it on a network page.
  • You want to include other WD sites near your location
  • You have two webservers and want to consolidate data onto one.
  • Might add it as a new service on WX-Host.com
  • Because I was trying to see if the Rain stuff worked and didn't have rain on my site
  • Because: [stick some other answer that has not yet been thought of yet here]

Other additions possible to the script:
  • I'm considering adding skeleton code to support a MySQL database but since I don't currently use one for WD, I'm not sure what schema's are being used and what the fields are.
  • Ability to graph other data in other clientraw files that have multiple values, such as from clientrawextra, solar, UV, Indoor Temp ...

Also working on doing the same thing with the regular sized charts...

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline gateway2capecod

  • Posts: 1,813
  • Middleborough, Ma. USA
    • Middleborough, Ma. Weather
Re: Sparkline
« Reply #102 on: November 18, 2007, 04:37:40 PM »
WOW...Glad I asked.

That sure is some good reason's, and will make the entire Newer Version more capable of doing more than the original. Great Idea's and looking forward to it's release.


I also wanted to ask if you think that it would be possible to somehow add the "WIND ROSE" Graphic that you made into the current conditions Bar, under wind Speed, next to the current wind Speed, in replace of the Ajax Text Arrows and Direction Text, that is in use now? If it was Possible to pull this off, the actual "Wind Rose Graphic would need to be resized to fit the tight space in that Section.

I took a screen shot of both images and then copied the Wind Rose from Branford fire/firewalls site, and then implanted it onto my wind current conditions bar picture. see the image below for the idea. not sure if this would ever be possible, but it would possiblly be a great place for us to use the wind rose grapghic

just an idea I thought of and would like to know if you like or dislike it..Chris


Offline gateway2capecod

  • Posts: 1,813
  • Middleborough, Ma. USA
    • Middleborough, Ma. Weather
Re: Sparkline
« Reply #103 on: November 18, 2007, 05:42:14 PM »
The above wind.jpg was using the actual size of the Wind Rose, as displayed on various sites that are using this.

The below Wind2.jpg is what it would look like if the wind rose grapghic were resized to 50 by 46..to fit in the wind section bar

Online TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Global Moderator
  • Posts: 5,865
  • Gremlins are at work...
  • Mesa, AZ
    • TNET Weather Station - Mesa AZ
Re: Sparkline
« Reply #104 on: November 18, 2007, 05:55:44 PM »
The windrose question is off topic.  Suggest you post it in the topic for Windrose Discussion.

All you need is Time, Aptitude and Desire ... and you can build just about anything...