Rev | Line | |
---|
[42] | 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(150,60); |
---|
| 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 cells in row 0 |
---|
| 15 | $table->MergeRow(0); |
---|
| 16 | |
---|
| 17 | // Setup font and color |
---|
| 18 | $table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14); |
---|
| 19 | $table->SetRowFillColor(0,'orange@0.5'); |
---|
| 20 | $table->SetRowColor(0,'darkred'); |
---|
| 21 | |
---|
| 22 | // Setup the minimum width of all columns |
---|
| 23 | $table->SetMinColWidth(35); |
---|
| 24 | |
---|
| 25 | // Add table to the graph |
---|
| 26 | $graph->Add($table); |
---|
| 27 | |
---|
| 28 | // ... send it back to the client |
---|
| 29 | $graph->Stroke(); |
---|
| 30 | |
---|
| 31 | ?> |
---|
| 32 | |
---|
Note: See
TracBrowser
for help on using the repository browser.