Location: PHPKode > projects > TimeSheet4dotProject > ts4dp/timesheet/testchart.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Timesheet4dP : User Graphs</title>
<link rel=stylesheet type="text/css" href="./css/main.css">
<link rel="stylesheet" type="text/css" href="./yui/fonts/fonts-min.css?_yuiversion=2.5.0" />
<script type="text/javascript" src="./yui/yahoo-dom-event/yahoo-dom-event.js?_yuiversion=2.5.0"></script>
<script type="text/javascript" src="./yui/json/json-beta.js?_yuiversion=2.5.0"></script>
<script type="text/javascript" src="./yui/element/element-beta.js?_yuiversion=2.5.0"></script>
<script type="text/javascript" src="./yui/datasource/datasource-beta.js?_yuiversion=2.5.0"></script>
<script type="text/javascript" src="./yui/charts/charts-experimental.js?_yuiversion=2.5.0"></script>
<script language="javascript" type="text/javascript" src="./js/getObj.js"></script> 
<!--begin custom header content for this example-->
<style type="text/css">
	.chart
	{
		float: left;
		width: 250px;
		height: 200px;
	}

	.chart_title
	{
		display: block;
		font-size: 1.2em;
		font-weight: bold;
		margin-bottom: 0.4em;
	}
</style>
<!--end custom header content for this example-->
</head>
<body class=" yui-skin-sam" bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br><br>

<table>
<tr><td align=center>Subject 1 (Date 1) <? echo $_POST["s1d1"] ?></td><td></td><td align=center>Subject 2 (Date 2) <? echo $_POST["s2d2"] ?></td><td></td><td>Difference Graph <br> (i.e If the below graph is blank/white,<br> Then it means "No Activity")</td></tr>
<tr><td><div id="chart1" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td><td>Vs</td><td><div id="chart2" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td><td>=</td><td><div id="chart3" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td></tr>
<tr><td><div id="chart1p" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td><td>Vs</td><td><div id="chart2p" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td><td>=</td><td><div id="chart3p" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td></tr>
<tr><td><div id="chart1t" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td><td>Vs</td><td><div id="chart2t" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td><td>=</td><td><div id="chart3t" class="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</div></td></tr>
</table>

<script type="text/javascript">
ResultSet1 = [{"total_time":"100","company_name":"Company"}]
ResultSet2 = [{"total_time":"100","company_name":"Company"}]
ResultSet3 = [{"total_time":"100","company_name":"Company"}]
//end php , start java script
// data to intialize project and task charts

ResultSet1p = [{"total_time":"100","project_name":"Select a Company"}]
ResultSet2p = [{"total_time":"100","project_name":"Select a Company"}]
ResultSet3p = [{"total_time":"100","project_name":"Select a Company"}]
ResultSet1t = [{"total_time":"100","task_name":"Select a Project"}]
ResultSet2t = [{"total_time":"100","task_name":"Select a Project"}]
ResultSet3t = [{"total_time":"100","task_name":"Select a Project"}]



	YAHOO.widget.Chart.SWFURL = "./yui/charts/assets/charts.swf?_yuiversion=2.5.0";

	var opinionData1c = new YAHOO.util.DataSource( ResultSet1 );
	opinionData1c.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData1c.responseSchema = { fields: [ "company_name", "total_time" ] };

	var opinionData2c = new YAHOO.util.DataSource( ResultSet2 );
	opinionData2c.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData2c.responseSchema = { fields: [ "company_name", "total_time" ] };
	
	var opinionData3c = new YAHOO.util.DataSource( ResultSet3 );
	opinionData3c.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData3c.responseSchema = { fields: [ "company_name", "total_time" ] };	
	
	//--- chart

	var mychart1c = new YAHOO.widget.PieChart( "chart1", opinionData1c,
	{
		dataField: "total_time",
		categoryField: "company_name",
		series: [{}]
	});

	var mychart2c = new YAHOO.widget.PieChart( "chart2", opinionData2c,
	{
		dataField: "total_time",
		categoryField: "company_name",
		series: [{}]
	});
	
	var mychart3c = new YAHOO.widget.PieChart( "chart3", opinionData3c,
	{
		dataField: "total_time",
		categoryField: "company_name",
		series: [{}]
	});
	
	var opinionData1p = new YAHOO.util.DataSource( ResultSet1p );
	opinionData1p.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData1p.responseSchema = { fields: [ "project_name", "total_time" ] };

	var opinionData2p = new YAHOO.util.DataSource( ResultSet2p );
	opinionData2p.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData2p.responseSchema = { fields: [ "project_name", "total_time" ] };
	
	var opinionData3p = new YAHOO.util.DataSource( ResultSet3p );
	opinionData3p.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData3p.responseSchema = { fields: [ "project_name", "total_time" ] };		

	var mychart1p = new YAHOO.widget.PieChart( "chart1p", opinionData1p,
	{
		dataField: "total_time",
		categoryField: "project_name",
		series: [{}]
	});

	var mychart2p = new YAHOO.widget.PieChart( "chart2p", opinionData2p,
	{
		dataField: "total_time",
		categoryField: "project_name",
		series: [{}]
	});
	
	var mychart3p = new YAHOO.widget.PieChart( "chart3p", opinionData3p,
	{
		dataField: "total_time",
		categoryField: "project_name",
		series: [{}]
	});
	
	var opinionData1t = new YAHOO.util.DataSource( ResultSet1t );
	opinionData1t.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData1t.responseSchema = { fields: [ "task_name", "total_time" ] };

	var opinionData2t = new YAHOO.util.DataSource( ResultSet2t );
	opinionData2t.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData2t.responseSchema = { fields: [ "task_name", "total_time" ] };
	
	var opinionData3t = new YAHOO.util.DataSource( ResultSet3t );
	opinionData3t.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	opinionData3t.responseSchema = { fields: [ "task_name", "total_time" ] };		

	var mychart1t = new YAHOO.widget.PieChart( "chart1t", opinionData1t,
	{
		dataField: "total_time",
		categoryField: "task_name",
		series: [{}]
	});

	var mychart2t = new YAHOO.widget.PieChart( "chart2t", opinionData2t,
	{
		dataField: "total_time",
		categoryField: "task_name",
		series: [{}]
	});
	
	var mychart3t = new YAHOO.widget.PieChart( "chart3t", opinionData3t,
	{
		dataField: "total_time",
		categoryField: "task_name",
		series: [{}]
	});	
</script>
</body>
</html>
Return current item: TimeSheet4dotProject