| 1 |
<?php |
| 2 |
include("/usr/local/share/jpgraph/jpgraph.php"); |
| 3 |
include("/usr/local/share/jpgraph/jpgraph_line.php"); |
| 4 |
include_once("inc/GetName.inc"); |
| 5 |
include_once("inc/GetCodeForStock.inc"); |
| 6 |
include_once("inc/GetLastPrices.inc"); |
| 7 |
include_once("inc/GetLastPriceDates.inc"); |
| 8 |
|
| 9 |
$ydata = getLastPrices($code,10); |
| 10 |
$xdata = getLastPriceDates($code,10); |
| 11 |
|
| 12 |
//var_dump($xdata); |
| 13 |
|
| 14 |
$graph = new Graph(320,240); |
| 15 |
$graph->SetScale("textlin"); |
| 16 |
$graph->img->SetMargin(30,90,40,50); |
| 17 |
|
| 18 |
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD); |
| 19 |
$graph->xaxis->SetTickLabels($xdata); |
| 20 |
$graph->xaxis->SetLabelAngle(90); |
| 21 |
|
| 22 |
$graph->yscale->SetAutoMin(0); |
| 23 |
|
| 24 |
$graph->title->set(getName($code)); |
| 25 |
|
| 26 |
$lineplot = new LinePlot($ydata); |
| 27 |
$lineplot->SetLegend("cents"); |
| 28 |
$lineplot->SetColor("blue"); |
| 29 |
|
| 30 |
$graph->Add($lineplot); |
| 31 |
|
| 32 |
$graph->Stroke(); |
| 33 |
?> |