Line | |
---|
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 | // Create a basic graph context |
---|
13 | $graph = new CanvasGraph(300,200); |
---|
14 | |
---|
15 | // Create a basic table |
---|
16 | $table = new GTextTable($cols,$rows); |
---|
17 | $table->Set($data); |
---|
18 | |
---|
19 | //Add table to the graph |
---|
20 | $graph->Add($table); |
---|
21 | |
---|
22 | // Send back table to the client |
---|
23 | $graph->Stroke(); |
---|
24 | |
---|
25 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.