JonathanS wrote:Is that the
only code? There's no config file?
Nothing above that to define what $jpgraph_path is?
Try replacing $jpgraph_path with the path from
the root (htdocs) to it is; that'd be /jpgraph-1.17-beta/ it sounds like.
Try it and see
No theres plenty more coding i just need the correct path, so that I can use the graphs, like on my host server it would be /home/me/public_html/weightlifting/jpgraph-1.17-beta/
Im trying to install this script
http://sourceforge.net/projects/wtfo/
This is full code
<?php
include ("./config.inc.php");
include ("$jpgraph_path/jpgraph.php");
include ("$jpgraph_path/jpgraph_line.php");
$query = 'SELECT weight, record FROM weight WHERE user = '.$_SESSION[userid].' ORDER BY record';
$result = mysql_query($query);
$i=0;
while ($row = mysql_fetch_array ($result)) {
$ydata[$i] = $row['weight'];
$xdata[$i] = $row['record'];
$i++;
}
/* SetScale($axtype,$ymin=1,$ymax=1,$xmin=1,$xmax=1) */
// Create the graph. These two calls are always required
$graph = new Graph(800,600,"auto");
$graph->SetScale("linlin");
$graph->img->SetMargin(60,140,60,60);
//$graph->xaxis->SetFont(FONT1,FS_BOLD);
$graph->title->Set("Weight vs Time");
/* $graph->SetScale(1,135,150,1,50); */
// Label every 2:nd tick mark
//$graph->xaxis->SetTickLabels(1);
//$graph->xaxis->SetTextTicks(5,0);
// Setup X-axis labels
$graph->xaxis->SetTickLabels($xdata);
$graph->xgrid->Show(true,false);
$graph->xaxis->SetLabelAngle(90);
// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetLegend("Weight(lbs)");
$lineplot->SetColor("blue");
// Add the plot to the graph
$graph->Add($lineplot);
// Display the graph
$graph->Stroke();
?>