Current location: Hot Scripts Forums » Programming Languages » PHP » Jpgraph


Jpgraph

Reply
  #1 (permalink)  
Old 06-11-04, 09:44 AM
rsuresh rsuresh is offline
Newbie Coder
 
Join Date: May 2004
Location: India
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Jpgraph

Hi all,

I got a problem regarding the JPgraph

I am able to generate a graph with the following code for the first time
<?php
include ("jpgraph.php");
include ("jpgraph_gantt.php");
// A new graph with automatic size
$graph = new GanttGraph(0,0,"auto");
// A new activity on row '0'
$activity = new GanttBar(0,"Project","2001−12−21","2002−02−20");
$graph−>Add($activity);
// Display the Gantt chart
$graph−>Stroke();
?>

But when i refreshed the browser the image went away , I dont know what happened . I tried renaming, copying the contents to a different file and ran it still it contains the same problem .

What is a better way to learn this type of chart creations ?

Please help .....

Thanks in Advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-15-04, 04:37 AM
Worm's Avatar
Worm Worm is offline
Newbie Coder
 
Join Date: Jun 2004
Location: Germany, Frankfurt am Main
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
The Problem you have is the image caching i think. i wrote a little script that deletes the cached image, if there is one and then regenerates a new one. Sample code:

function show_graph($url)
{
if(check_session("logged_in") != 0) // CHECK IF USER = LOGGEDIN
{
if(!empty($_GET["image"])) // CHECK WHICH DIAGRAM TO SHOW
{
$url = $_GET["image"];
}
$tempexplode = explode("/", $url); // REMOVE PATH FROM FILENAME
$temp = $tempexplode[(count($tempexplode) - 1)];

$temp = explode(".", $temp); // CHANGE FILE EXTENSION TO .PNG
$temp[0] .= ".png";

$delfile = $temp[0];

unlink("c:/temp/".$delfile); // DELETE CACHED PICTURE

echo '<img src="./jpgraph/pages/'.$url.'">'; // GENERATE NEW ONE
}
else
{
print_error("0001");
}
}

I hope this will help you !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
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
Displaying JPGraph with text below graph smombour PHP 4 02-02-06 03:41 PM
Jpgraph Dynamic rrdlopes PHP 1 02-03-04 11:19 AM
jpGraph axis labeling problem Squeezer PHP 2 08-20-03 08:53 AM


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