cloudy

Author Topic: MySQL -> JpGraph Interface  (Read 28701 times)

0 Members and 1 Guest are viewing this topic.

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #15 on: November 19, 2007, 08:05:04 PM »
Hi
I have changed fonts in multigraph.php, try this new upload.
I have also included a testfile.php, try that one and see if it outputs any values if the new multigraph.php does not work

 :) Krister
« Last Edit: January 11, 2008, 03:43:37 PM by kv-swe »

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: MySQL -> JpGraph Interface
« Reply #16 on: November 19, 2007, 08:38:20 PM »
Hi Krister

Still no luck.

There is a lot of things in this link - but im not sure what is means:

http://www.buskelundtoften.dk/vejret/multiwx/testfile.php

Best regards,

Henrik

Offline pinto

  • Posts: 766
  • Belgium
    • weather station Kampenhout
Re: MySQL -> JpGraph Interface
« Reply #17 on: November 19, 2007, 09:10:48 PM »
line 95 in multigraph.php
change
Code: [Select]
$graph->title->Pos(0.08, 0.02, "left", "top");in
Code: [Select]
$graph->title->SetPos(0.08, 0.02, "left", "top");for some strange reason some jpgraph-instalations don't uderstand the "Pos"
change it to "SetPos"

Jozef

hope this helps



Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: MySQL -> JpGraph Interface
« Reply #18 on: November 20, 2007, 05:09:51 AM »
Hi

That did the trick.

But when I try to make different graphs - only the temperature graph from today shows up.

http://www.buskelundtoften.dk/vejret/webpages/multiwx_en.php

Thanks for all your help.

Best regards,

Henrik

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #19 on: November 20, 2007, 07:04:13 PM »
Hi again
I have changed Pos to SetPos in the script (Thanks Jozef)  :)
I have also changed the initial query so it will load faster.
I have added a couple of files for testing if sessions and db-query works.
Make a time and data selection and click on create graph in: multiwx_en_test.php
Check the result in the S_SESSION array, and click on the link: open testfile.php below script timer.
If sessions works the new page will be filled with values from the selections.
You can test it here http://hasslosa.se/weather/webpages/multiwx_en_test.php (there is values between 2007-11-19 and 2007-11-20)

 :) Krister
« Last Edit: January 11, 2008, 03:44:03 PM by kv-swe »

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: MySQL -> JpGraph Interface
« Reply #20 on: November 21, 2007, 04:50:59 AM »
Hi Krister

Again thank you very much for your work on this.

Unfortunately still no luck - see this link:

http://www.buskelundtoften.dk/vejret/webpages/multiwx_en_test.php

Is still only shows the temp graph 24 hours back.

Best regards,

Henrik

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #21 on: November 21, 2007, 04:13:50 PM »
Hi Henrik
I think that php.ini on your server have register_globals = Off, and that messes things up.
Try this new upload, it should work. (i hope)  :roll:

 :) Krister

« Last Edit: January 11, 2008, 03:44:28 PM by kv-swe »

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: MySQL -> JpGraph Interface
« Reply #22 on: November 21, 2007, 05:21:06 PM »
Hi Krister

Woo hoo - now its working.

Thank you very very much for all your hard work on this great script.

You just made my day  :D

I now will work on translating it into Danish - what files do I need to change?

I can see, that creating the graph is very slow - but that must be my webhotel providers fault.

Have a nice evening over there in Sweden.

Best regards,

Henrik

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #23 on: November 21, 2007, 06:48:44 PM »
Hi Henrik  :)
I'm really glad it's working  :D
In common_en.php, translate the values in $db_fieldname = array  and $month = array and
the text under //Translate this ('Compare ' and ' with ') keep the blank space.
under //linecolor and labels for data-select, translate 'line ' and 'Not selected'.
You can add more values in the select droplist, copy them from $db_field = array like this: 63 => "heat_index", and translate/rearrange them.
In multiwx_en you can translate text between ><, like >Select time/date< to >Välj tid/datum<
You can copy the form to another page, just make sure to set the paths for
include '../multiwx/common_en.php';
src="../multiwx/setradio.js">
src="../multiwx/showhide.js">
href="../multiwx/multi.css" /> (You can copy the content to your regular css-file and skip this one, just remove the top section)
<img src="../multiwx/multigraph.php" alt="Graph" title="Weathergraph" />
right.
Your server is slow like a sleepy turtle   8O :lol:
I wonder why your temperature data don't have decimals?

 :) Krister

Offline Stuntman

  • Posts: 731
  • Hemet, California USA
    • Hemet Weather
Re: MySQL -> JpGraph Interface
« Reply #24 on: November 21, 2007, 07:55:00 PM »
Wow!!  I've been wanting this for a long time!!  Seems to work for me, but is there a simple way to change units to U.S. units?

Thanks!!!


Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #25 on: November 21, 2007, 08:21:34 PM »
Hi Robert
I'm glad you like it  :)
If your database contains US units just change the value in $db_units = array in common_en.php  like this:
$db_field      6 => "temperature"   9 => "daily_rainfall" ........
$db_units     6 => "°C"                9 => "mm"   change this to:  6 => "°F"   9 => "inch" .......

 :) Krister

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: MySQL -> JpGraph Interface
« Reply #26 on: November 21, 2007, 08:37:43 PM »
Hi Henrik  :)
I'm really glad it's working  :D
In common_en.php, translate the values in $db_fieldname = array  and $month = array and
the text under //Translate this ('Compare ' and ' with ') keep the blank space.
under //linecolor and labels for data-select, translate 'line ' and 'Not selected'.
You can add more values in the select droplist, copy them from $db_field = array like this: 63 => "heat_index", and translate/rearrange them.
In multiwx_en you can translate text between ><, like >Select time/date< to >Välj tid/datum<
You can copy the form to another page, just make sure to set the paths for
include '../multiwx/common_en.php';
src="../multiwx/setradio.js">
src="../multiwx/showhide.js">
href="../multiwx/multi.css" /> (You can copy the content to your regular css-file and skip this one, just remove the top section)
<img src="../multiwx/multigraph.php" alt="Graph" title="Weathergraph" />
right.
Your server is slow like a sleepy turtle   8O :lol:
I wonder why your temperature data don't have decimals?

 :) Krister

Hi again Krister

I have now changed the form to Danish - please see this link: http://www.buskelundtoften.dk/vejret/webpages/multiwx_dk.php

Is it possible to include the multiwx_dk.php into another php page?

Best regards,

Henrik

Ps. i wonder why my server is so slow - maybe i should contact my webhost.

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #27 on: November 21, 2007, 09:16:41 PM »
Hi again Henrik
Yes you can include it in another page.
copy everything between
   <!-- ##### Start Multigraph ##### -->
and
<!-- ##### End Multigraph ##### -->
and paste it into the new page
and paste
<?php
session_start();
include '../multiwx/common_en.php';
?>
at the top of the page

and put
<script type="text/javascript" src="../multiwx/setradio.js"></script>
<script type="text/javascript" src="../multiwx/showhide.js"></script>
<link rel="stylesheet" type="text/css" href="../multiwx/multi.css" /> (You can copy the content to your regular css-file and skip this one, just remove the top section)
in the head section of the page
and  <img src="../multiwx/multigraph.php" alt="Graph" title="Weathergraph" />
where you want the graph to appear.
make sure you get the paths right.

 :) Krister


Offline Stuntman

  • Posts: 731
  • Hemet, California USA
    • Hemet Weather
Re: MySQL -> JpGraph Interface
« Reply #28 on: November 21, 2007, 09:24:00 PM »
If your database contains US units
Well, that is the problem.. my db uses metric units, as that was the only choice when setting up mysql with WD when Brian first added the functionality.. the graphs would have to do conversions of units..  any chance I could talk you into adding that functionality?

convertCtoF
convertKTStoMPH
convertMMtoINCH
convertHPAtoINHG
You get the idea..

WD by default uses.. kts, C, mm, hpa
I would like to display.. mph, F, in, inHg


I don't know enough about php, but I'd imagine there is a way this could be done??

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: MySQL -> JpGraph Interface
« Reply #29 on: November 21, 2007, 09:35:00 PM »
Hi again Krister

I think this will be the final reply to your great script.

I like to say thank you very much for all your hard work getting this script to work on my website.

I have no included it to my excisting website:

www.buskelundtoften.dk/vejret/multigraf.php and in English www.buskelundtoften.dk/vejret/english/multigraf.php

Best regards,

Henrik