| Rev | Line |   | 
|---|
| [42] | 1 | <?php // content="text/plain; charset=utf-8"
 | 
|---|
 | 2 | // $Id: stockex2.php,v 1.1 2003/01/31 17:41:29 aditus Exp $
 | 
|---|
 | 3 | require_once ('jpgraph/jpgraph.php');
 | 
|---|
 | 4 | require_once ('jpgraph/jpgraph_stock.php');
 | 
|---|
 | 5 | 
 | 
|---|
 | 6 | 
 | 
|---|
 | 7 | $datay = array(
 | 
|---|
 | 8 |     34,42,27,45,
 | 
|---|
 | 9 |     55,25,12,59,
 | 
|---|
 | 10 |     38,49,32,64,
 | 
|---|
 | 11 |     34,40,29,42,
 | 
|---|
 | 12 |     40,29,22,45 );
 | 
|---|
 | 13 | 
 | 
|---|
 | 14 | // Setup basic graph
 | 
|---|
 | 15 | $graph = new Graph(300,200);
 | 
|---|
 | 16 | $graph->SetScale("textlin");
 | 
|---|
 | 17 | $graph->SetMarginColor('white');
 | 
|---|
 | 18 | $graph->SetFrame(false);
 | 
|---|
 | 19 | $graph->ygrid->SetFill(true,'#EFEFEF@0.5','#BBCCFF@0.5');
 | 
|---|
 | 20 | $graph->SetBox();
 | 
|---|
 | 21 | 
 | 
|---|
 | 22 | $graph->tabtitle->Set(' Week 34 ');
 | 
|---|
 | 23 | $graph->tabtitle->SetFont(FF_ARIAL,FS_NORMAL,12);
 | 
|---|
 | 24 | 
 | 
|---|
 | 25 | // Get week days in curent locale
 | 
|---|
 | 26 | $days = $gDateLocale->GetShortDay();
 | 
|---|
 | 27 | array_shift($days); // Start on monday
 | 
|---|
 | 28 | $graph->xaxis->SetTickLabels($days);
 | 
|---|
 | 29 | 
 | 
|---|
 | 30 | // Create stock plot
 | 
|---|
 | 31 | $p1 = new StockPlot($datay);
 | 
|---|
 | 32 | 
 | 
|---|
 | 33 | // Indent plot so first and last bar isn't on the edges
 | 
|---|
 | 34 | $p1->SetCenter();
 | 
|---|
 | 35 | 
 | 
|---|
 | 36 | // Add and stroke
 | 
|---|
 | 37 | $graph->Add($p1);
 | 
|---|
 | 38 | $graph->Stroke();
 | 
|---|
 | 39 | ?>
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.