source: trunk/xgraph/jpgraph/Examples/table_howto4.php

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 650 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,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 cells in row 0
15$table->MergeRow(0);
16
17// Set foreground and background color
18$table->SetCellFillColor(0,0,'orange@0.7');
19$table->SetCellColor(0,0,'darkred');
20
21// Add the table to the graph
22$graph->Add($table);
23
24// and send it back to the client
25$graph->Stroke();
26
27?>
28
Note: See TracBrowser for help on using the repository browser.