<?php

include ("jpgraph/jpgraph.php");
include ("jpgraph/jpgraph_line.php");

$graph = new Graph(300, 200, "auto"); 
$graph->SetFrame(true);
$graph->SetScale("textlin");
$graph->SetY2Scale("lin");

$graph->yaxis->SetColor(array(255, 0, 0));
$graph->y2axis->SetColor(array(0, 0, 255));

$graph->img->SetMargin(40, 40, 30, 30);

$ydata1 = array(10, 4, 7, 9, 2, 3);
$ydata2 = array(1200, 1800, 900, 300, 1100, 500);

$lineplot1 = new LinePlot($ydata1);
$lineplot1->SetColor(array(255, 0, 0));
$lineplot2 = new LinePlot($ydata2);
$lineplot2->SetColor(array(0, 0, 255));

$graph->Add($lineplot1);
$graph->AddY2($lineplot2);

$graph->Stroke();
?>