cloudy

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

0 Members and 2 Guests are viewing this topic.

Offline JyriT

  • Posts: 3
    • http://weather.mustalaatikko.org/
Re: MySQL -> JpGraph Interface
« Reply #150 on: February 23, 2010, 12:03:52 PM »
Minor question about multigraph.php,
Is it possible to define somehow which graph is drawn by default when using multigraph as a standalone (or part of a webpage)?
For example, I would love to have temp & barometer graphs on my default page http://weather.mustalaatikko.org/ but it seems that only temp is drawn by default..

Cheers
-- Jyri

Offline tstorm

  • Posts: 359
  • Harpers Ferry, WV
    • Meadowbrook Farm Weather
Re: MySQL -> JpGraph Interface
« Reply #151 on: February 23, 2010, 06:56:36 PM »
  I'm having issues with getting the graphical plot to show correctly: http://www.harpersferry-weather.com/wxmultigraph.php.  I have verdana.ttf in my http://www.harpersferry-weather.com/jpgraph-1.26/ttf dir and the jpg-config.inc.php points to this directory.  Sometimes when I first call up http://www.harpersferry-weather.com/wxmultigraph.php I get the temperatures to show, but most times it doesn't show up right.  Also,  if I select a weather element  other then the default (humidity, presurre etc..)  the graph is really messed up.   I'm using the WDMySQL database setup.  I would appreciate help in moving forward with this great script?

Thanks,

John
« Last Edit: February 24, 2010, 11:36:59 PM by tstorm »

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #152 on: February 25, 2010, 05:17:35 AM »
Hi
Jyri: I will work on the initial display so it can be used without selections, but it wil take some time.

John: what time-interval do you have in your uploads to the db? 1, 5 or 10 min?

 :)Krister

Offline tstorm

  • Posts: 359
  • Harpers Ferry, WV
    • Meadowbrook Farm Weather
Re: MySQL -> JpGraph Interface
« Reply #153 on: February 25, 2010, 09:34:26 AM »
I'm uploading to the db every 10 minutes.

John

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #154 on: February 25, 2010, 04:16:46 PM »
Hi John
Try attached testfile and see if it finds any data

 :) Krister

Offline tstorm

  • Posts: 359
  • Harpers Ferry, WV
    • Meadowbrook Farm Weather
Re: MySQL -> JpGraph Interface
« Reply #155 on: February 25, 2010, 07:05:48 PM »
Krister,

   I ran the test file at http://www.harpersferry-weather.com/multiwx/test.php .  It appears I didn't get any data from the 1st query but the 2nd it does.  I have notice that when I run http://www.harpersferry-weather.com/wxmultigraph.php that the default temps come up at times, but if I select to show a different variable then the graph is messed up.

  One other note is that the gui part (be able to select various weather parameters) of the scripts was missing from the latest zip file so I grabed one which was posted by someone.  Also, when you first call up wxmultigraph.php that when the temps show and if you change units for that the graph that the units don't change.

John
« Last Edit: February 25, 2010, 07:36:35 PM by tstorm »

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #156 on: February 25, 2010, 08:59:23 PM »
Hi John
You have to change all REGEXP '..:(00|10|20|30|40|50):..' in common_en.php so they match your datetimes ex: 00 should be 09
there are two folders in the zip-file,  multiwx_en.php are in the folder "webpages"
not sure about why units don't change, I'll check that tomorrow

 :) Krister


Offline tstorm

  • Posts: 359
  • Harpers Ferry, WV
    • Meadowbrook Farm Weather
Re: MySQL -> JpGraph Interface
« Reply #157 on: February 25, 2010, 10:54:51 PM »
Sorry, but I don't understanding the numbers that I need to put in for the REG.  I have tried a few different approaches to get it to work but no luck.  Attached is my latest attempt of the common_en.php file.

Thanks,

John

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #158 on: February 26, 2010, 04:40:27 AM »
try replacing the numbers with .. just to see if that works.
replace ..:(09|19|29|39|49|59):.. with ..:..:..

 :) Krister

Offline tstorm

  • Posts: 359
  • Harpers Ferry, WV
    • Meadowbrook Farm Weather
Re: MySQL -> JpGraph Interface
« Reply #159 on: February 26, 2010, 10:01:12 AM »
Replacing the numbers with .. didn't work.  I do get a plot up when first loading the page (sometimes have to hit graph for it to come up), but if select another weather parameter you get no graph.  If you run the test file there is a Warning: Wrong parameter count for min() in /home/harpersf/public_html/multiwx/testfile.php on line 38 .

I have also tried a second attempt at the common_en.php with the .. which is attached as common_en.php.txt2 which has the same results as using the first comm_en.php.txt file .

John

« Last Edit: February 27, 2010, 07:37:14 PM by tstorm »

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #160 on: February 27, 2010, 05:36:07 PM »
Hi
try removing
Code: [Select]
or die("getmysql error") from
Code: [Select]
$sql = mysql_query("$que1") or die("getmysql error"); in get_data.php and see what errormessages you get

Offline tstorm

  • Posts: 359
  • Harpers Ferry, WV
    • Meadowbrook Farm Weather
Re: MySQL -> JpGraph Interface
« Reply #161 on: February 27, 2010, 06:04:09 PM »
I still get the following when running http://www.harpersferry-weather.com/multiwx/testfile.php Warning: Wrong parameter count for min() in /home/harpersf/public_html/testfile.php on line 38

John

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #162 on: February 27, 2010, 07:10:01 PM »
I still get the following when running http://www.harpersferry-weather.com/multiwx/testfile.php Warning: Wrong parameter count for min() in /home/harpersf/public_html/testfile.php on line 38
that is not important.
I just tested your page and now the graphs work  :D

I see that your $_SESSION array have changed, i wonder if you have moved session_start(); in wxmultigraph.php?
« Last Edit: February 27, 2010, 07:23:46 PM by kv-swe »

Offline tstorm

  • Posts: 359
  • Harpers Ferry, WV
    • Meadowbrook Farm Weather
Re: MySQL -> JpGraph Interface
« Reply #163 on: February 27, 2010, 07:25:14 PM »
Krister -Thank you so much for hanging in there with me.  Not sure what corrected the problem, but it appears all is well.  Again, thanks for all of your help with this really nice script.   :D

One thing I noticed is if you select two or three variables from the gui that it covers up the date/time of the graph
« Last Edit: February 27, 2010, 08:17:26 PM by tstorm »

Offline kv-swe

  • Posts: 282
  • Sweden
    • Vädret i Hasslösa
Re: MySQL -> JpGraph Interface
« Reply #164 on: February 28, 2010, 10:08:39 PM »
Hi
I have updated the script so it is easy to make standalone graphs like this:

and add more graphs to a page, like this:http://www.hasslosa.se/weather/webpages/static_graphs.html
Update the files and modify settings below in the new file graph1.php to make your graphs ex: graph1 graph2.....
Code: [Select]
$size = '3'; //Graph size '1'=700x400 '2'=800x500 '3'=set size on next 2 lines
$h_size = '700'; //Horizontal size
$v_size = '400'; //Vertical size
$units = 'm'; //Units on graphs 'm' or 'us'
$lang = 'en'; //Language on graphs 'se'' or 'en'
$group1 = '3'; //Limits records from query '1', '2' or '3' 3 uses all data in selected interval (3 is not good for longer intervals!!)
$fix_date = '24 hour'; //Graph time-interval ex: '1 hour/day/month/year'
$field = array('6', '', ''); //Select what you want to graph from $db_field in common_en.php 1, 2 or 3 lines
$fill = '0'; //Fill line 2 '0' or '1'
and add them to your pages like this:
Code: [Select]
<img src="../multiwx/graph1.php" alt="Graph" title="Weathergraph" />
 :) Krister

 

cumulus