-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsample_table_pattern_merge.php
More file actions
51 lines (39 loc) · 915 Bytes
/
Copy pathsample_table_pattern_merge.php
File metadata and controls
51 lines (39 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
include_once 'Google.merge.v_1_0.php';
// main
$v = new Google_Visualization("Table_Format");
// config
$c = new Google_Config("Table");
$c->setProperty("allowHtml", true);
$c->setProperty("showRowNumber", true);
// format
$f = Google_Format::factory("Pattern");
$f->pattern('<a href="mailto:{1}">{0}</a>');
$f->format("data",array(0,1));
// data view
$d = new Google_Data_View;
$d->setColumns(array(0));
// data
$o = Google_Data::getInstance()->getDataObject();
$o->addColumn("0","Name","string");
$o->addColumn("1","Email","string");
$o->addNewRow();
$o->addStringCellToRow("Tom");
$o->addStringCellToRow("scaphare@gmail.com");
$o->addNewRow();
$o->addStringCellToRow("Mike");
$o->addStringCellToRow("mike@gmail.com");
$v->setConfig($c);
$v->setData($o);
$v->setFormat($f);
$v->setDataView($d);
?><html>
<head>
<?php
echo $v->render();
?>
</head>
<body>
<div id="chart"></div>
</body>
</html>