cloudy

Author Topic: Flash chart (from clientraw files) - OFC  (Read 36730 times)

0 Members and 3 Guests are viewing this topic.

Offline jmar

  • Posts: 1,405
  • Halifax, Canada
    • HRM Weather
Re: Flash chart (from clientraw files) - OFC
« Reply #345 on: August 07, 2009, 02:33:51 PM »
Lars,

Also make sure you change to 24 hour mode in graphsconf-usa.php.
Line 21:
Code: [Select]
//Set this variable to either 12 or 24 depending on whether you run Weather Display in 12  or 24 hour mode
$hourmode = "24";

On the time zone issue -
What exactly is the code you are using for your Time Zone? I assume it conforms to the time zone document available for the template, correct?

Make sure you have your PC set to automatically update DST time changes. I have seen where folks have correctly mmanually set there time in the control panel but not set the DST setting, then after a change they have script issue, because their time is hardcoded and the scripts are automatic. Don't know if this applies but do some double checking on your PC first. If the time was manually set during Standard time, and SAT cuts in, your PC won't know if the auto setting isn't turned on, but a script can calculate it from the date, and voila, one hour ahead in a certain script.

Also, I haven't mentioned before because most systems are php 5 now... but there is a chance your system is php4 or earlier? If so, you may want to try the older time zone setting as a test. I don't know your zone but mine was set at AST4ADT if I recall. The AST is the time zone for standard time and ADT is Atlantic Daylight Time (for DST setting) and php3 or 4 did the calcs right from there.

Try that in the settings file and see if your ajax updates still work with correct time, then try it on the flash chart hour scripts. Just guessing because I haven't seen this issue before, but that might work.

Someone smarter than me might want to jump in here if you see anything I haven't covered for Lars' issue. Thanks.

Hope this helps
Jim
« Last Edit: August 07, 2009, 02:44:15 PM by jmar »
iMac, 2 x Mac Mini, Mac OS X 10.6.7, Indigo integration, Web - WDL, Saratoga templates, Lightbox

Offline Axelvold

  • Posts: 980
  • Axelvold / Sweden
  • Axelvold, Sverige
    • Axelvold's weather and photo
Re: Flash chart (from clientraw files) - OFC
« Reply #346 on: August 07, 2009, 05:25:07 PM »
Thanks Jim, that did work.

I did change to MET-1METDST and now is it showing the right time on the 1 hour charts.

Here is a link to a page with all time zones. http://www.steltor.com/notes/corptime-server/5_4/refmanual/refappd.htm
« Last Edit: August 07, 2009, 05:27:51 PM by Axelvold »



Offline jmar

  • Posts: 1,405
  • Halifax, Canada
    • HRM Weather
Re: Flash chart (from clientraw files) - OFC
« Reply #347 on: August 07, 2009, 08:26:16 PM »
That's exceptional Lars, and you have a great site too! Very creative. I will stress again that the time zone you used will at some point be deprecated/retired and the original "TZ=" setting in the file is now recommended in newer versions of php as I understand it.

Glad to help out.
All the best,
Jim
« Last Edit: August 07, 2009, 08:36:23 PM by jmar »
iMac, 2 x Mac Mini, Mac OS X 10.6.7, Indigo integration, Web - WDL, Saratoga templates, Lightbox

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 22,157
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
    • http://www.realweatherstation.com
Re: Flash chart (from clientraw files) - OFC
« Reply #348 on: August 07, 2009, 09:00:50 PM »
Jim

To avoid any confusion, for 5.1 onwards the way to set it is using date_default_timezone_set('America/Halifax'), your putenv("TZ=America/Halifax") is the old way.

Offline jmar

  • Posts: 1,405
  • Halifax, Canada
    • HRM Weather
Re: Flash chart (from clientraw files) - OFC
« Reply #349 on: August 07, 2009, 11:00:27 PM »
LoL ... DUHH  ... Sorry about that. I wasn't clear in what I was describing ( the "America/Halifax" value over the "AST4ADT"). 
And I also didn't know about the newest setting so thanks for the heads up Niko, as always, we'd be lost without you guys! Guess I'll start changing code again!

All the best!
iMac, 2 x Mac Mini, Mac OS X 10.6.7, Indigo integration, Web - WDL, Saratoga templates, Lightbox

Offline kartal01

  • Posts: 35
    • Kartal időjárása
Re: Flash chart (from clientraw files) - OFC
« Reply #350 on: February 20, 2010, 01:45:15 PM »
Hi

OFC was put up in the week but the graph does not work properly.
I realized that the file responsible for it clientrawdaily.txt Do you have any idea what could be the problem?
Here is the link: http://www.idojaras.mobilbankar.net/wxflashchart-week.php
                  http://idojaras.mobilbankar.net/clientrawdaily.txt
Attila

Offline asksashko

  • Posts: 1
Re: Flash chart (from clientraw files) - OFC
« Reply #351 on: February 21, 2010, 06:09:57 AM »
Any body can send me on asksashko@yandex.ru 

wxflashchart-week.php
wxflashchart-month.php


Offline mav101

  • Posts: 10
Re: Flash chart (from clientraw files) - OFC
« Reply #352 on: March 14, 2010, 11:22:55 PM »
Hi,

These graphs are great  :D   Did anyone produce a complete downloadable set?

Cheers, Andy

Offline edje1205

  • edje
  • Posts: 1,838
  • Zaandam Holland, the Netherlands
    • http://www.weersverwachtingen.eu
Re: Flash chart (from clientraw files) - OFC
« Reply #353 on: March 17, 2010, 04:34:03 PM »


still no graph (see att) only values  #-o

open-flash-chart is in the root
http://www.weersverwachtingen.eu/open-flash-chart.swf
page is at
http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxchartpage.php

what am I doing wrong  :?
Ed
Woodenshoes,mills,hightech;but random weather
www.weersverwachtingen.eu
P4 2,2Ghz-2GB RAM-Win2K-Broadb.connect


Offline edje1205

  • edje
  • Posts: 1,838
  • Zaandam Holland, the Netherlands
    • http://www.weersverwachtingen.eu
Re: Flash chart (from clientraw files) - OFC
« Reply #354 on: March 18, 2010, 09:32:59 AM »
hi Chuck


thnx for the messages, in the mean while I tried to find out what was going wrong but I can't figure it out, this is a part of the code I have at wxchartpage.php

Code: [Select]
Include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>

<div id="main-copy">
<?php
include("../../chart-outside-temp.php");
?>
 

</div><!-- end main-copy -->

<?php
############################################################################
include("footer.php")

wxchartpage is here:http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxchartpage.php
chart-outside-temp.php is in the root, as well as the swf file open-flash-chart.swf.
what only give me a graphic without values

hoping I'm not doing duhhh  :lol:
Ed
Woodenshoes,mills,hightech;but random weather
www.weersverwachtingen.eu
P4 2,2Ghz-2GB RAM-Win2K-Broadb.connect


Offline andro700

  • Chuck
  • Posts: 3,213
  • Watford City, North Dakota
    • Chuck's Weather Page
Re: Flash chart (from clientraw files) - OFC
« Reply #355 on: March 18, 2010, 10:14:05 PM »
Ed,

Here is one of pages that I use for my OFC pages.

Code: [Select]
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>

<!-- begin of javascript 'go to top' arrow -->

<div id="floatdiv" class="jsupoutline">
    <a href="#header" title="Goto Top of Page" class="jsuparrow">
    <img src="<?php echo $SITE['imagesDir']; ?>toparrow.gif" alt="^^"
   style="border: 0px;" /></a>

</div>
<script src="floatTop.js" type="text/javascript"></script>

<!-- end of javascript 'go to top' arrow -->

<div id="main-copy">
 
  <h1 align="center">Open Flash Charts</h1>
<div align="center">
             <br />
       </div>
    <p align="center">
<b>What is Open Flash Chart?</b><br />
Open Flash Chart is an add-on Flash movie for graphing data which allows you to see live
weather data over the web from your weatherstation in nearly real time.
This Weather Display weather station data is updated every 3 seconds but the graphs update
every 5 minutes. To see data hover over the data lines.</p>

<p align="center">
Find out more about Open Flash Chart (OFC) ...
<a href="http://teethgrinder.co.uk/open-flash-chart/index.php" title="Add OFC to your website," target="_blank">Add OFC to your website</a></p>
<br /><br />
<div id="horizontal-menu">
<div align="center">
  <ul>
    <li><a href="http://www.chucksweather.com/ofc-last-hour.php" title="Last Hour">Last Hour</a></li>
    <li><span class="menuLinkSelectedhoriz">24 Hour Graphs</span></li>
    <li><a href="http://www.chucksweather.com/ofc-last-7days.php" title="7 Day Graphs">7 Day Graphs</a></li>
    <li><a href="http://www.chucksweather.com/ofc-last-31days.php" title="Month Graphs">Month Graphs</a></li>
    <li><a href="http://www.chucksweather.com/ofc-rain.php" title="Rain Graphs">Rain Graphs</a></li>
      </ul>
    </div>
</div> 
<div align="center"><br />
  <br />
</div>
<div align="center">
    <?php
include_once 'ofc-library/open_flash_chart_object.php';
open_flash_chart_object700430'http://'$_SERVER['SERVER_NAME'] .'/temp-hum-dew-last24.php'false );

    echo 
'<br/> <br/>';

open_flash_chart_object700430'http://'$_SERVER['SERVER_NAME'] .'/barohPa-last24.php'false );

    echo 
'<br/> <br/>';

open_flash_chart_object700430'http://'$_SERVER['SERVER_NAME'] .'/baroinHg-last24.php'false );

    echo 
'<br/> <br/>';
    
open_flash_chart_object700430'http://'$_SERVER['SERVER_NAME'] .'/wind-dir-last24.php'false );
?>

    <br />
    <br />
   
  </div>
</div>

<!-- end main-copy -->

<?php
############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>


Chuck

Offline edje1205

  • edje
  • Posts: 1,838
  • Zaandam Holland, the Netherlands
    • http://www.weersverwachtingen.eu
Re: Flash chart (from clientraw files) - OFC
« Reply #356 on: March 19, 2010, 11:17:58 AM »
Thnx Chuck, but no luck

with this

Code: [Select]
<?php
include_once './ofc-library/open_flash_chart_object.php';
open_flash_chart_object700430'http://'$_SERVER['SERVER_NAME'] .'chart-outside-temp.php 'false );

    echo 
'<br/> <br/>';

open_flash_chart_object700430'http://'$_SERVER['SERVER_NAME'] .'baro-24hr.php'false );

    echo 
'<br/> <br/>';

open_flash_chart_object700430'http://'$_SERVER['SERVER_NAME'] .'temp-hilo-31days.php'false );

    echo 
'<br/> <br/>';
    
open_flash_chart_object700430'http://'$_SERVER['SERVER_NAME'] .'/winddir-24hr.php'false );
?>


I do now have the graph but without values see att

and
http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxchartpage.php  :)

with this code
Code: [Select]
<div id="horizontal-menu">
<div align="center">
  <ul>
    <li><a href="http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/temp-1hr.php" title="Last Hour">Last Hour</a></li>
    <li><span class="menuLinkSelectedhoriz">24 Hour Graphs</span></li>
    <li><a href="http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/flashgraphs_24hrs.php" title="7 Day Graphs">7 Day Graphs</a></li>
    <li><a href="http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/flashgraphs_month.php" title="Month Graphs">Month Graphs</a></li>
    <li><a href="http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/rain-this-month.php" title="Rain Graphs">Rain Graphs</a></li>
      </ul>

got the flash charts but not in another outfit not with glassbar etc  :roll:


http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/temp-1hr.php

can you send me one of those
ofc-last-hour.php and
wind-dir-last24.php ?, please
so I can see the structure of calling the script.

I believe we do have a beginning with the (empty :oops:) graphs  !
Hope I did not edit the wrong config files  :lol:
Ed
Woodenshoes,mills,hightech;but random weather
www.weersverwachtingen.eu
P4 2,2Ghz-2GB RAM-Win2K-Broadb.connect


Offline andro700

  • Chuck
  • Posts: 3,213
  • Watford City, North Dakota
    • Chuck's Weather Page
Re: Flash chart (from clientraw files) - OFC
« Reply #357 on: March 20, 2010, 08:48:51 PM »
Here is my temp-hum-dewpoint last 24 hour.

Code: [Select]
<?php

$hostloc 
"./";
$clientrawextra get_raw("${hostloc}clientrawextra.txt");

function 
get_raw$rawfile ) {
$rawdata = array();
$fd fopen($rawfile"r");
if (
$fd) {
$rawcontents '';
while (! 
feof ($fd) ) {
$rawcontents .= fread($fd8192);
}
fclose($fd);
$delimiter " ";
$rawdata explode ($delimiter$rawcontents);
} else {
$rawdata[0]= -9999;
}
return 
$rawdata;
}

//
// Create aray for y-axis
// 
//temp============================================================================
$y=array($clientrawextra['21'],$clientrawextra['22'],$clientrawextra['23'],$clientrawextra['24'],
$clientrawextra['25'],$clientrawextra['26'],$clientrawextra['27'],$clientrawextra['28'],$clientrawextra['29'],
$clientrawextra['30'],$clientrawextra['31'],$clientrawextra['32'],$clientrawextra['33'],$clientrawextra['34'],
$clientrawextra['35'],$clientrawextra['36'],$clientrawextra['37'],$clientrawextra['38'],$clientrawextra['39'],
$clientrawextra['40'],$clientrawextra['566'],$clientrawextra['567'],$clientrawextra['568'],$clientrawextra['569']);
$data $y;
//hum=============================================================================
$y=array($clientrawextra['611'],$clientrawextra['612'],$clientrawextra['613'],$clientrawextra['614'],
$clientrawextra['615'],$clientrawextra['616'],$clientrawextra['617'],$clientrawextra['618'],$clientrawextra['619'],
$clientrawextra['620'],$clientrawextra['621'],$clientrawextra['622'],$clientrawextra['623'],$clientrawextra['624'],
$clientrawextra['625'],$clientrawextra['626'],$clientrawextra['627'],$clientrawextra['628'],$clientrawextra['629'],
$clientrawextra['630'],$clientrawextra['631'],$clientrawextra['632'],$clientrawextra['633'],$clientrawextra['634']);
$data2 $y;
//---------------------
//calculation for dew -
//---------------------

$Tc[1] = $clientrawextra[21];
$Tc[2] = $clientrawextra[22];
$Tc[3] = $clientrawextra[23];
$Tc[4] = $clientrawextra[24];
$Tc[5] = $clientrawextra[25];
$Tc[6] = $clientrawextra[26];
$Tc[7] = $clientrawextra[27];
$Tc[8] = $clientrawextra[28];
$Tc[9] = $clientrawextra[29];
$Tc[10] = $clientrawextra[30];
$Tc[11] = $clientrawextra[31];
$Tc[12] = $clientrawextra[32];
$Tc[13] = $clientrawextra[33];
$Tc[14] = $clientrawextra[34];
$Tc[15] = $clientrawextra[35];
$Tc[16] = $clientrawextra[36];
$Tc[17] = $clientrawextra[37];
$Tc[18] = $clientrawextra[38];
$Tc[19] = $clientrawextra[39];
$Tc[20] = $clientrawextra[40];
$Tc[21] = $clientrawextra[566];
$Tc[22] = $clientrawextra[567];
$Tc[23] = $clientrawextra[568];
$Tc[24] = $clientrawextra[569];

$RH[1]= $clientrawextra[611];
$RH[2]= $clientrawextra[612];
$RH[3]= $clientrawextra[613];
$RH[4]= $clientrawextra[614];
$RH[5]= $clientrawextra[615];
$RH[6]= $clientrawextra[616];
$RH[7]= $clientrawextra[617];
$RH[8]= $clientrawextra[618];
$RH[9]= $clientrawextra[619];
$RH[10]= $clientrawextra[620];
$RH[11]= $clientrawextra[621];
$RH[12]= $clientrawextra[622];
$RH[13]= $clientrawextra[623];
$RH[14]= $clientrawextra[624];
$RH[15]= $clientrawextra[625];
$RH[16]= $clientrawextra[626];
$RH[17]= $clientrawextra[627];
$RH[18]= $clientrawextra[628];
$RH[19]= $clientrawextra[629];
$RH[20]= $clientrawextra[630];
$RH[21]= $clientrawextra[631];
$RH[22]= $clientrawextra[631];
$RH[23]= $clientrawextra[633];
$RH[24]= $clientrawextra[634];

//dew array in degrees F
$dewF = array();
for (
$i 1;$i 25;$i++)
{
$dewF array_merge($dewF,array(DEWF($Tc[$i],$RH[$i])));
}
//dew array in Celcius
$dewC = array();
for (
$i 1;$i 25;$i++)
{
$dewC array_merge($dewC,array(DEWC($Tc[$i],$RH[$i])));
}


//
//function
//
// Calculate dewF
function DEWF($Tc,$RH) {
         
$Es=6.11*pow(10.0,(7.5*$Tc/(237.7+$Tc)));
         
$E=($RH*$Es)/100;
         
$Tdc=(-430.22+237.7*log($E))/(-log($E)+19.08);
         
$Tdcsprintf ("%01.1f"$Tdc);
$Tdf 1.8*$Tdc+32;
  return 
$Tdf;
// end function calculate dewC

// Calculate dewC
function DEWC($Tc,$RH) {
         
$Es=6.11*pow(10.0,(7.5*$Tc/(237.7+$Tc)));
         
$E=($RH*$Es)/100;
         
$Tdc=(-430.22+237.7*log($E))/(-log($E)+19.08);
         
$Tdcsprintf ("%01.1f"$Tdc);

  return 
$Tdc;
// end function calculate dewC

// CtoF: converts degrees Celcius to degrees F
function CtoF(&$value,$key) {
  
$value round($value = ((1.8$value) + 32),1);
// end function C_to_F

//----------------------------
//end of calculation for dew -
//----------------------------

//create timearray for the x-axis
$x=array($clientrawextra['459'],$clientrawextra['460'],$clientrawextra['461'],$clientrawextra['462'],
$clientrawextra['463'],$clientrawextra['464'],$clientrawextra['465'],$clientrawextra['466'],$clientrawextra['467'],
$clientrawextra['468'],$clientrawextra['469'],$clientrawextra['470'],$clientrawextra['471'],$clientrawextra['472'],
$clientrawextra['473'],$clientrawextra['474'],$clientrawextra['475'],$clientrawextra['476'],$clientrawextra['477'],
$clientrawextra['478'],$clientrawextra['578'],$clientrawextra['579'],$clientrawextra['580'],$clientrawextra['581']);
$datat $x;


$y_min round(min($dewF)-1);

//------------------------------------------
// use the chart class to build the chart: -
//------------------------------------------
include_once( 'ofc-library/open-flash-chart.php' );
$g = new graph();

// title
$g->title('Last 24 Hours Temperature - Dew Point - Humidity Data','{text-align:center; font-size:18px; color: #10C8CD; margin: 5px; background-color: #213240; padding:2px}');
$g->bg_colour '#90AEC6';
$g->set_inner_background'#DBE3F0''#8D96A8'45 );

//right axis (humidity)
//we do this first, so the others plot over the area
//otherwise, the others will be under the area and will not be clear(covered by the area)
$g->set_data$data2 );
$g->area_hollow24,25'#213240''Humidity '12 );
$g->attach_to_y_right_axis(1);//see number 1, it is the 1st $g->set_data
$g->set_y_right_max100 );
$g->y_right_axis_colour'#213240''#213240' );
$g->set_y_right_label_style10'#213240' );

// left axis (dew)
$g->set_data$dewF );
$g->line_dot2,5'FAF93C''Dew'12 );
$y_min round(min($dewF)-5);

array_walk($data,'CtoF');
$y_max round(max($data)+3);
$g->set_data$data );
$g->line_dot25'#EC1559''Temp '12 );
$g->y_axis_colour'#EC1559''#000000' );
$g->set_y_label_style10'#EC1559' );

// set the Y max and min and label-steps
$g->set_y_min$y_min );
$g->set_y_max$y_max );
$g->y_label_steps16 );
$g->set_tool_tip'#key#<br>#x_label#<br> #val#' );


// label each point with its value
$g->set_x_labels($datat);
$g->set_x_axis_steps);
$g->x_axis_colour'#213240''#000000' );
$g->set_x_label_style12'#213240'21'#213240' );

$g->set_x_legend'Last 24 Hours'12'#213240' );
$g->set_y_legend'Temp °F'12'#EC1559' );
$g->set_y_right_legend'Humidity Percent'12'#213240' );
// display the data
echo $g->render();
?>


Chuck

Offline jmar

  • Posts: 1,405
  • Halifax, Canada
    • HRM Weather
Re: Flash chart (from clientraw files) - OFC
« Reply #358 on: March 23, 2010, 02:30:44 PM »

still no graph (see att) only values  #-o

open-flash-chart is in the root
http://www.weersverwachtingen.eu/open-flash-chart.swf
page is at
http://www.weersverwachtingen.eu/clientraw/wd-ajax-ml/wxchartpage.php

what am I doing wrong  :?

Ed,

Looking at your page source, the calling code is all wrong on wxchartpage. I don't know where calling the clientraw files in the page came from, it needs to call the chart files individually. I recommend you start over. I will send you my best package. You need to delete the files starting with "chart***  as well as the wxchartpage.php you need to change the calling code for your chart pages to the code in my email to you.

I will need your email address. email me via the link on the left ok?

Hope this gets you fixed up.
Jim

iMac, 2 x Mac Mini, Mac OS X 10.6.7, Indigo integration, Web - WDL, Saratoga templates, Lightbox

Offline jmar

  • Posts: 1,405
  • Halifax, Canada
    • HRM Weather
Re: Flash chart (from clientraw files) - OFC
« Reply #359 on: March 23, 2010, 02:37:49 PM »
Also, can someone help me in a rain chart I saw when I first got the charts? I modified it because my station wasn't 2 years old at the time but now it is and would like to find that original file. It was named "chart-rain-year.php"   and it showed the current month as well as the average month. I modified it to only give the current month until I had the past data but can't find the original.

The chart looks like this now but should have 2 columns for each month one with the average data in it. I asked Michael for it but I se he changed his charts on his site so he must not have it anymore.

If you have the old file or can find the link to it in the original package from last year I would really appreciate it.

All the best
Jim

 
« Last Edit: March 23, 2010, 02:41:51 PM by jmar »
iMac, 2 x Mac Mini, Mac OS X 10.6.7, Indigo integration, Web - WDL, Saratoga templates, Lightbox

 

cumulus