source: trunk/xgraph/jpgraph/Examples/tableex02.php

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 864 bytes
Line 
1<?php
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_canvas.php');
4require_once ('jpgraph/jpgraph_table.php');
5
6$cols = 4;
7$rows = 3;
8$data = array( array('','Jan','Feb','Mar','Apr'),
9               array('Min','15.2', '12.5', '9.9', '70.0'),
10               array('Max','23.9', '14.2', '18.6', '71.3'));
11
12$graph = new CanvasGraph(300,200);
13
14$table = new GTextTable($cols,$rows);
15$table->Init();
16$table->Set($data);
17
18// Setup row and column headers
19$table->SetRowFont(0,FF_TIMES,FS_BOLD,11);
20$table->SetRowAlign(0,'left','bottom');
21$table->SetRowColor(0,'navy');
22$table->SetRowFillColor(0,'lightgray');
23$table->SetColFont(0,FF_ARIAL,FS_BOLD,11);
24$table->SetColColor(0,'navy');
25$table->SetColFillColor(0,'lightgray');
26
27// Highlight cell 2,3
28$table->SetCellFillColor(2,3,'yellow');
29
30$graph->Add($table);
31$graph->Stroke();
32
33?>
Note: See TracBrowser for help on using the repository browser.