I'm trying to make a graph that shows the average speed, for some dataplots. I have this code:
<?
include("include/jpgraph/jpgraph.php");
include("include/jpgraph/jpgraph_bar.php");
$datay=array(26,22,32);
// Create the graph. These two calls are always required
$graph = new Graph(300,200,"auto");
$graph->SetScale("textlin");
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,30,40);
// Create a bar pot
$bplot = new BarPlot($datay);
$graph->Add($bplot);
// Setup the titles
$graph->title->Set("Average speed");
$graph->xaxis->title->Set("Date");
$graph->yaxis->title->Set("Average km/h");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
// Display the graph
$graph->Stroke();
?>
At the x-axis it shows the numbers 1-3. Instead I want to print my dates eg. "06/02-06", "08/02-06" and "11/02-06".
Can you tell me how to do this?