예제 #1
0
//SET ACTION
$GoogleCharts->setAction(array('id' => 'sample', 'text' => 'See sample book', 'action' => 'function(){
		selection = chart.getSelection();
		switch (selection[0].row)
		{
			case 0: alert("Ender\'s Game"); break;
			case 1: alert("Feynman Lectures on Physics"); break;
			case 2: alert("Numerical Recipes in JavaScript"); break;
			case 3: alert("Truman"); break;
			case 4: alert("Freakonomics"); break;
			case 5: alert("The Mezzanine"); break;
			case 6: alert("The Color of Magic"); break;
			case 7: alert("The Law of Superheroes"); break;
		}}'));
//SET OPTIONS
$GoogleCharts->options(array('tooltip' => array('trigger' => 'selection')));
/**
*	CHART
*/
$chart = $GoogleCharts->load('pie', 'tooltip_action')->get();
?>
<!DOCTYPE HTML>
<html>
	<head>
		<title>Google Chart</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="description" content="Description" />
		<link rel="stylesheet" href="Stylesheet Location" type="text/css" />
	</head>
	<body>
		<h1>Google Chart</h1>
//UPDATE COLUMN
$GoogleCharts->updateColumn(4, 0, 'Watch TV');
//APPEND ROW
$GoogleCharts->appendRow(array());
//APPED COLUMN
$GoogleCharts->appendColumn(5, 5);
//PREPEND COLUMN
$GoogleCharts->prependColumn(5, 'This');
//DELETE ROW
$GoogleCharts->deleteRow(5);
//DELETE COLUMN
$GoogleCharts->deleteColumn(1, 0);
//PREPEND COLUMN
$GoogleCharts->prependColumn(1, 'Working');
//SET OPTIONS
$GoogleCharts->options(array("title" => "The decline of 'The 39 Steps'"));
/**
*	CHART
*/
$chart = $GoogleCharts->load('pie', 'chart_div')->get();
?>
<!DOCTYPE HTML>
<html>
	<head>
		<title>Google Chart</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="description" content="Description" />
		<link rel="stylesheet" href="Stylesheet Location" type="text/css" />
		
	</head>
	<body>