Agan mau tanya bagaimana menampilkan grafik (graph.php) ke halaman utama (index.php), mohon pencerahannya para suhu?. Thanks.
<?php // content="text/plain; charset=utf-8"
require_once ('fasilitas/chart/jpgraph.php');
require_once ('fasilitas/chart/jpgraph_bar.php');
$datay=array(62,105,85,200);
// Create the graph. These two calls are always required
$graph = new Graph(350,220,'auto');
$graph->SetScale("textlin");
//$theme_class="DefaultTheme";
//$graph->SetTheme(new $theme_class());
// set major and minor tick positions manually
$graph->yaxis->SetTickPositions(array(0,30,60,90,120,150,180,210), array(15,45,75,105,135,165,195));
$graph->SetBox(false);
//$graph->ygrid->SetColor('gray');
$graph->ygrid->SetFill(false);
$graph->xaxis->SetTickLabels(array('A','B','C','D'));
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);
// Create the bar plots
$b1plot = new BarPlot($datay);
// ...and add it to the graPH
$graph->Add($b1plot);
$b1plot->SetColor("white");
$b1plot->SetFillGradient("#4B0082","white",GRAD_LEFT_REFLECTION);
$b1plot->SetWidth(45);
$b1plot->value->show();
$graph->title->Set("Bar Gradient(Left reflection)");
// Display the graph
$graph->Stroke();
?>
//di halaman utamanya
<tr>
<td bgcolor="#FFFFFF" class="grafikku" align="center"><img src="images/grafik.jpg" width="142" height="35">
<div align="center>"><?php include "graph.php"; ?></div></td>
</tr>
<tr>