Current location: Hot Scripts Forums » Programming Languages » PHP » Dynamic Image help


Dynamic Image help

Reply
  #1 (permalink)  
Old 09-22-03, 09:13 AM
jacobe jacobe is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Dynamic Image help

I want to create graphs based on values from database.
Can any one suggest good tutorial for this with good codes or some sample code so that
I can work because I am new to GD Library and PHP.

Any help is highly appreciable.

Thanks

Jc
Reply With Quote
  #2 (permalink)  
Old 09-23-03, 05:00 PM
Perry Perry is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Tennessee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Talking

The absolute best solution I've found is jpGraph

http://www.aditus.nu/jpgraph/

There are many example files in the download package.
Reply With Quote
  #3 (permalink)  
Old 09-23-03, 05:07 PM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
I would definately second that. Jpgraph is absolutely the best.
Reply With Quote
  #4 (permalink)  
Old 09-24-03, 02:25 AM
jacobe jacobe is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
I downloaded JPGraph. When I run it 's giving error

JpGraph Error: No path specified for CACHE_DIR. Please specify a path for that DEFINE in jpgraph.php

Here what path I have to give?

Thanks

Jc
Reply With Quote
  #5 (permalink)  
Old 09-24-03, 02:39 AM
Perry Perry is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Tennessee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Cache Path

It's been awhile since I installed jpGraph, but the path you enter should be your web server path -- something like

/home/user/www/...

this varies from server to server. A good way to find this out, among other things is to make a .php file and in it type this

<?
phpinfo();
?>

save that file to your server's root and go to it in a web browser.

When you do, you should see a section called Apache Environment, under that should be an entry called DOCUMENT_ROOT

add to this your web path to to jpgraph cache directory and you're good to go
Reply With Quote
  #6 (permalink)  
Old 09-24-03, 03:11 AM
jacobe jacobe is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry for asking as I am new to this.

I did enter all the details, it's not working. Can you please clarify where exactly
I have to enter the path.Below is the section

if (!defined('CACHE_DIR')) {
if ( strstr( PHP_OS, 'WIN') ) {
if( empty($_SERVER['TEMP']) ) {
die('JpGraph Error: No path specified for CACHE_DIR. Please specify a path for that DEFINE in jpgraph.php');
}
else {
DEFINE('c:/program files/apache group/apache/htdocs', $_SERVER['TEMP'] . '/');
}
} else {
DEFINE('CACHE_DIR','/tmp/jpgraph_cache/');
}
}

Any help is highly appreciable and thanks

Jc
Reply With Quote
  #7 (permalink)  
Old 09-24-03, 03:26 AM
Perry Perry is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Tennessee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Whatever changes you made, undo them

I just looked at my jpgraph.php and I see a section like this:

// Directories for cache and font directory.
// Leave them undefined to use default values.
//
// Default values used if these defines are left commented out are:
//
// UNIX:
// CACHE_DIR = /tmp/jpgraph_cache/
DEFINE('TTF_DIR','/home/image1/www/jpgraph/fonts/');

//
// WINDOWS:
// CACHE_DIR = $SERVER_TEMP/jpgraph_cache/
// TTF_DIR = $SERVER_SYSTEMROOT/fonts/
//
//

try un-commenting the CACHE_DIR = $SERVER_TEMP/jpgraph_cache/ line

if that doesn't work, create this directory C:\tmp\
Reply With Quote
  #8 (permalink)  
Old 09-24-03, 03:48 AM
jacobe jacobe is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Uncommented that line under windows.

Now I am getting errors

Warning: Unknown(jpgraph_plotmark.inc): failed to open stream: No such file or directory in Unknown on line 0

Fatal error: (null)(): Failed opening required 'jpgraph_plotmark.inc' (include_path='.;C:\php4\includes\pear') in Unknown on line 0


Any advice?

Jc
Reply With Quote
  #9 (permalink)  
Old 10-15-03, 04:55 AM
coachy2001 coachy2001 is offline
New Member
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
By the looks of it i am having the same problem as you described. Did you manage to solve this and get Jpgraph working? If so could you let me know how as i have been banging my head against this problem for days and its starting to hurt!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic image src = Newbie question clintre PHP 1 10-07-03 09:56 AM
camera phone image poster apt2 Script Requests 2 08-29-03 07:20 PM
A different kind of image counter Stix Script Requests 1 08-11-03 11:50 PM
Dynamic Navigation Menu! edigitalxp ASP 1 08-01-03 12:35 AM
Skript to convert email to image spade PHP 1 06-11-03 09:28 AM


All times are GMT -5. The time now is 06:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.