cloudy

Author Topic: Sparkline  (Read 21778 times)

0 Members and 1 Guest are viewing this topic.

Bashy

  • Guest
Re: Sparkline
« Reply #15 on: October 11, 2007, 04:34:15 AM »
In sparkline.php there is a list of colour defaults
I edited that to the colour i wanted,

Code: [Select]
function SetColorDefaults() {
    $this->Debug("Sparkline :: SetColorDefaults()", DEBUG_SET);
    $colorDefaults = array(array('aqua',   '#00FFFF'),
                           array('black',  '#010101'), // TODO failure if 000000?
                           array('blue',   '#0000FF'),
                           array('fuscia', '#FF00FF'),
                           array('gray',   '#EEEEEE'),
                           array('grey',   '#808080'),
                           array('green',  '#008000'),
                           array('lime',   '#00FF00'),
                           array('maroon', '#800000'),
                           array('navy',   '#000080'),
                           array('olive',  '#808000'),
                           array('purple', '#800080'),
                           array('red',    '#FF0000'),
                           array('silver', '#C0C0C0'),
                           array('teal',   '#008080'),
                           array('white',  '#FFFFFF'),
                           array('yellow', '#FFFF00'));

Thee, further up in the sparline.php i edited the colour that i just added i further down

Code: [Select]
$this->colorList       = array();
    $this->colorBackground = 'gray';
    $this->lineSize        = 1;
    $this->graphAreaPx = array(array(0, 0), array(0, 0)); // px(L, B), px(R, T)
  } // function Sparkline

that makes them all change at the same time without having to edit every 1 of the 4 .php files

As you can see, theres 2 greys by default, 1 is grey and the other is gray, i just used the gray
and added the colour i wanted to gray lol :)

« Last Edit: October 11, 2007, 04:36:48 AM by Bashy »

Offline edje1205

  • edje
  • Posts: 1,818
  • Zaandam Holland, the Netherlands
    • http://www.weersverwachtingen.eu
Re: Sparkline
« Reply #16 on: October 11, 2007, 09:01:17 AM »


Of course play around with some colors in list and voila, much better for me !
Thanks both....

Any idea for transparent or e.g. clouds.jpg in this background ?

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


Bashy

  • Guest
Re: Sparkline
« Reply #17 on: October 11, 2007, 03:10:34 PM »
Ya welcome, glad ya got it sorted :)

as for an image you could always try the image code in place of the colour hex, worth a try,
then just choose the colour where you placed ya image, ya might need to add background somewhere in there.......

e.g.

Code: [Select]
function SetColorDefaults() {
    $this->Debug("Sparkline :: SetColorDefaults()", DEBUG_SET);
    $colorDefaults = array(array('aqua',   '#00FFFF'),
                           array('black',  '#010101'), // TODO failure if 000000?
                           array('blue',   '#0000FF'),
                           array('fuscia', '#FF00FF'),
                           array('gray',   '#EEEEEE'),
                           array('grey',   '#808080'),
                           array('green',  '#008000'),
                           array('lime',   '#00FF00'),
                           array('maroon', '#800000'),
                           array('navy',   '<img border="0" width="500" height="146" id="_x0000_i1025" src="http://www.someurl.com/to-youre/image.jpg" alt="image text">
                           array('olive',  '#808000'),
                           array('purple', '#800080'),
                           array('red',    '#FF0000'),
                           array('silver', '#C0C0C0'),
                           array('teal',   '#008080'),
                           array('white',  '#FFFFFF'),
                           array('yellow', '#FFFF00'));

btw, i aint tested it so it might not work, tis just an idea is all lol
« Last Edit: October 11, 2007, 03:18:48 PM by Bashy »

Offline Stcobb

  • Posts: 67
  • Little Elm, Texas
    • Steve's Weather Page
Re: Sparkline
« Reply #18 on: October 13, 2007, 10:36:31 AM »
Just started working with this, thanks for the script pinto.
I am trying to do the same but for wind. Can any one tell me which "numbers" in the clientrawhour.txt to use for wind speed?

Also, did anyone figure out how to convert the temp file from C to F?

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: Sparkline
« Reply #19 on: October 13, 2007, 10:40:11 AM »
Hi

Kevin (Krelvinaz) has made a script to see what the clientraw files contains off.

See this link:

http://www.tnetweather.com/wd-parser.php

Hope that helps.

Best regards,

Henrik

Offline jmcmurry

  • Jim McMurry
  • Posts: 2,213
  • Mauston, WI, USA
    • Juneau County Weather
Re: Sparkline
« Reply #20 on: October 13, 2007, 11:23:19 AM »
Attached is what I did for temp & wind.  I've messed with the fonts and titles, but you should be able to get what you need out of the files.

- Jim

 Home of NSLog NexStorm Lightning Data Manager

Offline Stcobb

  • Posts: 67
  • Little Elm, Texas
    • Steve's Weather Page
Re: Sparkline
« Reply #21 on: October 13, 2007, 01:30:18 PM »
Thanks for the files to compare to, Jim.

Offline pinto

  • Posts: 766
  • Belgium
    • weather station Kampenhout
Re: Sparkline
« Reply #22 on: October 23, 2007, 07:00:11 AM »
http://www.weather-watch.com/smf/index.php/topic,27095.0.html

update of zip-file

problem was temperatures below zero not plotted

Jozef

Bashy

  • Guest
Re: Sparkline
« Reply #23 on: October 23, 2007, 07:03:05 AM »
Hi Pinto

Can i please ask what was modified as i have already modified mine and dont really want to
start again (if i can help it) tia!

Offline pinto

  • Posts: 766
  • Belgium
    • weather station Kampenhout
Re: Sparkline
« Reply #24 on: October 23, 2007, 07:11:58 AM »
Code: [Select]
//  if (ereg('^[0-9\.]+$', $value)) {

    $sparkline->SetData($i, $value);
    if (null == $max ||
        $value >= $max[1]) {
      $max = array($i, $value);
    }

    if (null == $min ||
        $value <= $min[1]) {
      $min = array($i, $value);
    }

    $last = array($i, $value);

    $i++;
  }
//}
comment first and last line of this part in temp.php
or remove the first and last line of this part

Jozef
« Last Edit: October 23, 2007, 07:14:47 AM by pinto »

Bashy

  • Guest
Re: Sparkline
« Reply #25 on: October 23, 2007, 07:15:44 AM »
Thanks a lot Jozef appreciated :)

Offline AM1234

  • Posts: 363
  • Beamsville, Ontario, Canada
    • Beamsville Weather Station
Re: Sparkline
« Reply #26 on: October 23, 2007, 12:56:34 PM »
Is there a way to display the data in a bar graph?
Ann-Marie
Beamsville, Ontario, Canada

Offline pinto

  • Posts: 766
  • Belgium
    • weather station Kampenhout
Re: Sparkline
« Reply #27 on: October 23, 2007, 01:05:41 PM »
Is there a way to display the data in a bar graph?
Yes, but I did not try that

maybe if you are interested take a look here http://sparkline.org/

Offline pinto

  • Posts: 766
  • Belgium
    • weather station Kampenhout
Re: Sparkline
« Reply #28 on: October 23, 2007, 01:43:04 PM »
Is there a way to display the data in a bar graph?


if you want to use this, you must have the libraries(see zip in first post)

« Last Edit: October 24, 2007, 05:48:48 PM by pinto »

Offline AM1234

  • Posts: 363
  • Beamsville, Ontario, Canada
    • Beamsville Weather Station
Re: Sparkline
« Reply #29 on: October 23, 2007, 03:05:35 PM »
Thanks very much :)
Ann-Marie
Beamsville, Ontario, Canada