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 | // Create a canvas graph where the table can be added |
---|
7 | $graph = new CanvasGraph(70,50); |
---|
8 | |
---|
9 | // Setup the basic table |
---|
10 | $data = array( array(1,2,3,4),array(5,6,7,8)); |
---|
11 | $table = new GTextTable(); |
---|
12 | $table->Set($data); |
---|
13 | |
---|
14 | // Merge all cellsn in the rectangle with |
---|
15 | // top left corner = (0,2) and bottom right = (1,3) |
---|
16 | $table->MergeCells(0,2,1,3); |
---|
17 | |
---|
18 | // Add the table to the graph |
---|
19 | $graph->Add($table); |
---|
20 | |
---|
21 | // ... and send back the table to the client |
---|
22 | $graph->Stroke(); |
---|
23 | |
---|
24 | ?> |
---|
25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.