//echo get_user_meta($membership_id, 'membership_status',true)."<BR>";
    $member_ship_count = count(get_users(array('role' => 'member', 'meta_key' => 'membership_status', 'meta_value' => $retrive)));
    $member_ship_array[] = array('member_ship_id' => $retrive, 'member_ship_count' => $member_ship_count);
    //echo $member_ship.",";
}
//var_dump($member_ship_array);
$chart_array = array();
$chart_array[] = array('Membership', 'Number Of Member');
foreach ($member_ship_array as $r) {
    $chart_array[] = array($r['member_ship_id'], $r['member_ship_count']);
}
//var_dump($chart_array);
//exit;
$options = array('title' => __('Membership by status'), 'colors' => array('#22BAA0', '#F25656', '#12AFCB'));
require_once GMS_PLUGIN_DIR . '/lib/chart/GoogleCharts.class.php';
$GoogleCharts = new GoogleCharts();
$chart = $GoogleCharts->load('PieChart', 'chart_div')->get($chart_array, $options);
?>
<script type="text/javascript">
$(document).ready(function() {
	
	$('.sdate').datepicker({dateFormat: "yy-mm-dd"}); 
	$('.edate').datepicker({dateFormat: "yy-mm-dd"}); 

 
} );
</script>

    	
    
  <div id="chart_div" style="width: 100%; height: 500px;"></div>
<?php

/**
*	INCLUDE CLASS
*/
include dirname(dirname(__FILE__)) . '/src/GoogleCharts.class.php';
$GoogleCharts = new GoogleCharts();
/**
*	DATA
*/
$data = array(array('Mon', 20, 28, 38, 45), array('Tue', 31, 38, 55, 66), array('Wed', 50, 55, 77, 80), array('Thu', 77, 77, 66, 50), array('Fri', 68, 66, 22, 15));
// Treat first row as data as well.
$GoogleCharts->firstRowAsData();
/**
*	OPTIONS
*/
$options = array('title' => 'Correlation between life expectancy, fertility rate and population of some world countries (2010)', 'hAxis' => array('title' => 'Life Expectancy'), 'vAxis' => array('title' => 'Fertility Rate'), 'bubble' => array('textStyle' => array('fontSize' => 11)));
/**
*	CHART
*/
$chart = $GoogleCharts->load('candlestick', 'chart_div')->get($data, $options);
?>
<!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>
예제 #3
0
<?php

/**
*	INCLUDE CLASS
*/
include dirname(dirname(__FILE__)) . '/src/GoogleCharts.class.php';
$GoogleCharts = new GoogleCharts();
/**
*	DATA
*/
$data = array(array('Year', 'Sales', 'Expenses'), array('2004', 1000, 400), array('2005', 1170, 460), array('2006', 660, 1120), array('2007', 1030, 540));
/**
*	OPTIONS
*/
$options = array('title' => 'Company Performance', 'hAxis' => array('title' => 'Year', 'titleTextStyle' => array('color' => 'red')));
/**
*	CHART
*/
$chart = $GoogleCharts->load('bar', 'chart_div')->get($data, $options);
?>
<!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>
예제 #4
0
$table_class = $wpdb->prefix . 'gmgt_class_schedule';
//$sdate = $_REQUEST['sdate'];
//$edate = $_REQUEST['edate'];
$sdate = '2015-09-01';
$edate = '2015-09-10';
$chart_array = array();
$report_2 = $wpdb->get_results("SELECT  at.user_id,\n\t\t\t\t\tSUM(case when `status` ='Present' then 1 else 0 end) as Present,\n\t\t\t\t\tSUM(case when `status` ='Absent' then 1 else 0 end) as Absent\n\t\t\t\t\tfrom {$table_attendance} as at where at.attendence_date >  DATE_SUB(NOW(), INTERVAL 1 WEEK)  AND at.role_name = 'staff_member' GROUP BY at.user_id");
$chart_array[] = array(__('Staff Member', 'gym_mgt'), __('Present', 'gym_mgt'), __('Absent', 'gym_mgt'));
if (!empty($report_2)) {
    foreach ($report_2 as $result) {
        $user_name = gym_get_display_name($result->user_id);
        $chart_array[] = array("{$user_name}", (int) $result->Present, (int) $result->Absent);
    }
}
$options = array('title' => __('Staff Attendance Report', 'gym_mgt'), 'titleTextStyle' => array('color' => '#66707e', 'fontSize' => 14, 'bold' => true, 'italic' => false, 'fontName' => 'open sans'), 'legend' => array('position' => 'right', 'textStyle' => array('color' => '#66707e', 'fontSize' => 14, 'bold' => true, 'italic' => false, 'fontName' => 'open sans')), 'hAxis' => array('title' => __('Staff Member', 'gym_mgt'), 'titleTextStyle' => array('color' => '#66707e', 'fontSize' => 14, 'bold' => true, 'italic' => false, 'fontName' => 'open sans'), 'textStyle' => array('color' => '#66707e', 'fontSize' => 10), 'maxAlternation' => 2), 'vAxis' => array('title' => __('No of Staff Member', 'gym_mgt'), 'minValue' => 0, 'maxValue' => 5, 'format' => '#', 'titleTextStyle' => array('color' => '#66707e', 'fontSize' => 14, 'bold' => true, 'italic' => false, 'fontName' => 'open sans'), 'textStyle' => array('color' => '#66707e', 'fontSize' => 12)), 'colors' => array('#22BAA0', '#f25656'));
$GoogleCharts = new GoogleCharts();
$chart = $GoogleCharts->load('column', 'attendance_report_staff')->get($chart_array, $options);
?>
				<div class="panel panel-white">
					<div class="panel-heading">
						<h3 class="panel-title"><?php 
_e('Staff Attendance', 'gym_mgt');
?>
</h3>						
					</div>
					<div class="panel-body">
						<div id="attendance_report_staff" style="width: 100%; height: 500px;">
						<?php 
if (empty($report_2)) {
    _e('There is not enough data to generate report', 'gym_mgt');
}
예제 #5
0
		  <script type="text/javascript">
					<?php 
    if (!empty($arm_data) && count($arm_data) > 1) {
        echo $arm_chart;
    }
    ?>
				</script>
					</div>
				</div>
			</div>
	<!--FAT REPORT -->	
		<?php 
    $fat_data = $obj_gym->get_weight_report('Fat', $user_id);
    $option = $obj_gym->report_option('Fat');
    require_once GMS_PLUGIN_DIR . '/lib/chart/GoogleCharts.class.php';
    $GoogleCharts = new GoogleCharts();
    $fat_chart = $GoogleCharts->load('LineChart', 'fat_report')->get($fat_data, $option);
    ?>
		<div class="col-md-6 col-sm-6 col-xs-12">
				<div class="panel panel-white">
					<div class="panel-heading">
						<h3 class="panel-title"><?php 
    _e('Fat Progress Report', 'gym_mgt');
    ?>
</h3>						
					</div>
					<div class="panel-body">
						<div id="fat_report" style="width: 100%; height: 250px;">
						<?php 
    if (empty($fat_data) || count($fat_data) == 1) {
        _e('There is not enough data to generate report', 'gym_mgt');
예제 #6
0
<?php

/**
*	INCLUDE CLASS
*	Show:	https://developers.google.com/chart/interactive/docs/customizing_tooltip_content?hl=es#tooltip_actions
*/
include dirname(dirname(__FILE__)) . '/src/GoogleCharts.class.php';
$GoogleCharts = new GoogleCharts();
//SET DATA
$GoogleCharts->arrayToDataTable(array(array('Genre', 'Percentage of my books'), array('Science Fiction', 217), array('General Science', 203), array('Computer Science', 175), array('History', 155), array('Economics & Political Science', 98), array('General Fiction', 72), array('Fantasy', 51), array('Law', 29)));
//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();
?>
예제 #7
0
<?php

/**
*	INCLUDE CLASS
*/
include dirname(dirname(__FILE__)) . '/src/GoogleCharts.class.php';
$GoogleCharts = new GoogleCharts();
/**
*	DATA
*/
$data = array(array('Country', 'Popularity'), array('Germany', 200), array('United States', 300), array('Brazil', 400), array('Canada', 500), array('France', 600), array('RU', 700));
/**
*	CHART
*/
$chart = $GoogleCharts->load('geo', 'chart_div')->get($data);
?>
<!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>
		<div id="chart_div" style="width: 900px; height: 500px;"></div>
		
		<!-- Javascript -->
		<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<?php

/**
*	INCLUDE CLASS
*/
include dirname(dirname(__FILE__)) . '/src/GoogleCharts.class.php';
$GoogleCharts = new GoogleCharts();
/**
*	DATA
*/
$data = array(array('Task', 'Hours per Day'), array('Work', 11), array('Eat', 2), array('Commute', 2), array('Watch Television', 2));
//SET DATA
$GoogleCharts->arrayToDataTable($data);
// ROW
$GoogleCharts->updateRow(1, array('Wandering', 12));
//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'"));
<?php

/**
*	INCLUDE CLASS
*/
include dirname(dirname(__FILE__)) . '/src/GoogleCharts.class.php';
$GoogleCharts = new GoogleCharts();
/**
*	DATA
*/
$data = array(array('Director (Year)', 'Rotten Tomatoes', 'IMDB'), array('Alfred Hitchcock (1935)', 8.4, 7.9), array('Ralph Thomas (1959)', 6.9, 6.5), array('Don Sharp (1978)', 6.5, 6.4), array('James Hawes (2008)', 4.4, 6.2));
$options = array("title" => "The decline of 'The 39 Steps'", "vAxis" => array("title" => 'Accumulated Rating'), "isStacked" => true);
/**
*	CHART
*/
$chart = $GoogleCharts->load('stepped', 'chart_div')->get($data, $options);
?>
<!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>
		<div id="chart_div" style="width: 900px; height: 500px;"></div>
		
		<!-- Javascript -->