1 | <?php
|
---|
2 | require_once ('jpgraph/jpgraph.php');
|
---|
3 | require_once ('jpgraph/jpgraph_canvas.php');
|
---|
4 | require_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 | ?>
|
---|