| <?php 
require_once ("jpgraph/jpgraph.php");
require_once ("jpgraph/jpgraph_line.php");
require_once ("jpgraph/jpgraph_scatter.php");
 
$datay = array(
    array(4,26,15,44),
    array(20,51,32,20));
 
$graph = new Graph(300,200);
$graph->SetMarginColor('white');
$graph->SetScale("textlin");
$graph->SetFrame(false);
$graph->SetMargin(30,5,25,20);
 
$graph->xgrid->Show();
 
$graph->xaxis->SetTickLabels($gDateLocale->GetShortMonth());
 
$p1 = new LinePlot($datay[0]);
$p1->SetColor("navy");
 
$p1->mark->SetType(MARK_FLAG1,197);
 
$p1->value->SetFormat('%d mil');
$p1->value->Show();
$p1->value->SetColor('darkred');
$p1->value->SetFont(FF_ARIAL,FS_BOLD,10);
$p1->value->SetMargin(14);
 
$p1->SetCenter();
 
$graph->Add($p1);
 
$p2 = new LinePlot($datay[1]);
$p2->SetColor("navy");
 
$p2->mark->SetType(MARK_FLAG1,'united states');
 
$p2->value->SetFormat('%d mil');
$p2->value->Show();
$p2->value->SetColor('darkred');
$p2->value->SetFont(FF_ARIAL,FS_BOLD,10);
$p2->value->SetMargin(14);
 
$p2->SetCenter();
$graph->Add($p2);
 
$graph->Stroke();
 
?> |