source: trunk/xgraph/jpgraph/Examples/table_howto5.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 693 bytes
Line 
1<?php
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_canvas.php');
4require_once ('jpgraph/jpgraph_table.php');
5
6// Create a canvas graph where the table can be added
7$graph = new CanvasGraph(70,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// Adjust font in cell (0,0)
18$table->SetCellFont(0,0,FF_ARIAL,FS_BOLD,14);
19
20// Set left align for all cells in rectangle (0,0) - (0,3)
21$table->SetAlign(0,0,0,3,'Left');
22
23// Add table to graph
24$graph->Add($table);
25
26// ... send it back to the client
27$graph->Stroke();
28
29?>
30
Note: See TracBrowser for help on using the repository browser.