|
tool tip problems |
Posted by M_jay on Feb-01-2011 19:10 |
|
I want to add tool tips to points of my graphs.
I have used database values for the tool tips values
$dis =array($m1,$m2,$m3,$m4,$m5,$m6,$m7,$m8,$m9,$m10,$m11,$m12,$m13,$m14,$m15,$m16,$m17,$m18,$m19,$m20,$m21,$m22,$m23,$m24,$m25,$m26,$m27,$m28,$m29,$m30,$m31,$m32,$m33,$m34,$m35,$m36,$m37,$m38,$m39,$m40,$m41,$m42,$m43,$m44,$m45,$m46,$m47);
I have attached my required graph and code of the graph.
Can you help me to solve my problem.
| | | | |
Qua_Analysis_Default.php |
---|
<?php
require_once("C:/xampp/php/ext/phpchartdir.php");
$con = mysql_connect("localhost:3306","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mygraphs", $con);
$v=1;
$k0=0;
$k1=0;
$k2=0;
$k3=0;
$k4=0;
$k5=0;
$k6=0;
$k7=0;
$k8=0;
$sn0=0;
$sn1=0;
$sn2=0;
$sn3=0;
$sn4=0;
$sn5=0;
$sn6=0;
$sn7=0;
$sn8=0;
$ab=0;
Do{
switch($v){
case 1:
$d1="Select Variable From factor Where FactorName='Economy' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Economy' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length1 =$row['c'];
break;
case 2:
$w++;
$d1="Select Variable From factor Where FactorName='HealthyLifestyle' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='HealthyLifestyle' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length2 =$row['c'];
break;
case 3:
$w++;
$d1="Select Variable From factor Where FactorName='Urban Growth' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Urban Growth' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length3 =$row['c'];
break;
case 4:
$w++;
$d1="Select Variable From factor Where FactorName='Transport' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Transport' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length4 =$row['c'];
break;
case 5:
$w++;
$d1="Select Variable From factor Where FactorName='Crime & Safety' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Crime & Safety' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length5 =$row['c'];
break;
case 6:
$w++;
$d1="Select Variable From factor Where FactorName='Commiunity ' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Commiunity' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length6 =$row['c'];
break;
case 7:
$w++;
$d1="Select Variable From factor Where FactorName='Environment' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Environment' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length7 =$row['c'];
break;
case 8:
$w++;
$d1="Select Variable From factor Where FactorName='Education' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Education' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length8 =$row['c'];
break;
case 9:
$w++;
$d1="Select Variable From factor Where FactorName='Health' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Health' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length9 =$row['c'];
break;
} //end sw
$sum = 0;
while($row = mysql_fetch_array($rd1))
{
$f = $row['Variable'] ;
switch($f){
case q2_1:
$d2 = mysql_query("Select AVG(Q2_1) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_1'");
$row = mysql_fetch_array($la);
$m1=$row['j'];
break;
case q2_2:
$d2 = mysql_query("Select AVG(Q2_2) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_2'");
$row = mysql_fetch_array($la);
$m2=$row['j'];
// echo $m;
break;
case q2_3:
$d2=mysql_query("Select AVG(Q2_3) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_3'");
$row = mysql_fetch_array($la);
$m3=$row['j'];
break;
case q2_4:
$d2=mysql_query("Select AVG(Q2_4) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_4'");
$row = mysql_fetch_array($la);
$m4=$row['j'];
break;
case q2_5:
$d2=mysql_query("Select AVG(Q2_5) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_5'");
$row = mysql_fetch_array($la);
$m5=$row['j'];
break;
case q2_6:
$d2=mysql_query("Select AVG(Q2_6) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_6'");
$row = mysql_fetch_array($la);
$m6=$row['j'];
break;
case q2_7:
$d2=mysql_query("Select AVG(Q2_7) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_7'");
$row = mysql_fetch_array($la);
$m7=$row['j'];
break;
case q2_8:
$d2=mysql_query("Select AVG(Q2_8) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_8'");
$row = mysql_fetch_array($la);
$m8=$row['j'];
// echo $n;
break;
case q2_9:
$d2=mysql_query("Select AVG(Q2_9) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_9'");
$row = mysql_fetch_array($la);
$m9=$row['j'];
// echo $n;
break;
case q2_10:
$d2=mysql_query("Select AVG(Q2_10) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_10'");
$row = mysql_fetch_array($la);
$m10=$row['j'];
// echo $n;
break;
case q2_11:
$d2=mysql_query("Select AVG(Q2_11) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_11'");
$row = mysql_fetch_array($la);
$m11=$row['j'];
// echo $n;
break;
case q2_12:
$d2=mysql_query("Select AVG(Q2_12) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_12'");
$row = mysql_fetch_array($la);
$m12=$row['j'];
// echo $n;
break;
case q2_13:
$d2=mysql_query("Select AVG(Q2_13) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_13'");
$row = mysql_fetch_array($la);
$m13=$row['j'];
// echo $n;
break;
case q2_14:
$d2=mysql_query("Select AVG(Q2_14) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_14'");
$row = mysql_fetch_array($la);
$m14=$row['j'];
// echo $n;
break;
case q2_15:
$d2=mysql_query("Select AVG(Q2_15) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_15'");
$row = mysql_fetch_array($la);
$m15=$row['j'];
// echo $n;
break;
case q2_16:
$d2=mysql_query("Select AVG(Q2_16) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_16'");
$row = mysql_fetch_array($la);
$m16=$row['j'];
// echo $n;
break;
case q2_17:
$d2=mysql_query("Select AVG(Q2_17) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_17'");
$row = mysql_fetch_array($la);
$m17=$row['j'];
// echo $n;
break;
case q2_18:
$d2=mysql_query("Select AVG(Q2_18) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_18'");
$row = mysql_fetch_array($la);
$m18=$row['j'];
// echo $n;
break;
case q2_19:
$d2=mysql_query("Select AVG(Q2_19) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_19'");
$row = mysql_fetch_array($la);
$m19=$row['j'];
// echo $n;
break;
case q2_20:
$d2=mysql_query("Select AVG(Q2_20) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_20'");
$row = mysql_fetch_array($la);
$m20=$row['j'];
// echo $n;
break;
case q2_21:
$d2=mysql_query("Select AVG(Q2_21) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_21'");
$row = mysql_fetch_array($la);
$m21=$row['j'];
// echo $n;
break;
case q2_22:
$d2=mysql_query("Select AVG(Q2_22) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_22'");
$row = mysql_fetch_array($la);
$m22=$row['j'];
// echo $n;
break;
case q2_23:
$d2=mysql_query("Select AVG(Q2_23) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_23'");
$row = mysql_fetch_array($la);
$m23=$row['j'];
// echo $array;
// echo $n;
break;
case q2_24:
$d2=mysql_query("Select AVG(Q2_24) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_24'");
$row = mysql_fetch_array($la);
$m24=$row['j'];
// echo $n;
break;
case q2_25:
$d2=mysql_query("Select AVG(Q2_25) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_25'");
$row = mysql_fetch_array($la);
$m25=$row['j'];
// echo $n;
break;
case q2_26:
$d2=mysql_query("Select AVG(Q2_26) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_26'");
$row = mysql_fetch_array($la);
$m26=$row['j'];
// echo $n;
break;
case q2_27:
$d2=mysql_query("Select AVG(Q2_27) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_27'");
$row = mysql_fetch_array($la);
$m27=$row['j'];
// echo $n;
break;
case q2_28:
$d2=mysql_query("Select AVG(Q2_28)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_28'");
$row = mysql_fetch_array($la);
$m28=$row['j'];
// echo $n;
break;
case q2_29:
$d2=mysql_query("Select AVG(Q2_29)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_29'");
$row = mysql_fetch_array($la);
$m29=$row['j'];
// echo $n;
break;
case q2_30:
$d2=mysql_query("Select AVG(Q2_30)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_30'");
$row = mysql_fetch_array($la);
$m30=$row['j'];
// echo $n;
case q2_31:
$d2=mysql_query("Select AVG(Q2_31)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_31'");
$row = mysql_fetch_array($la);
$m31=$row['j'];
// echo $n;
break;
case q2_32:
$d2=mysql_query("Select AVG(Q2_32)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_32'");
$row = mysql_fetch_array($la);
$m32=$row['j'];
// echo $n;
break;
case q2_33:
$d2=mysql_query("Select AVG(Q2_33)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_33'");
$row = mysql_fetch_array($la);
$m33=$row['j'];
// echo $n;
break;
case q2_34:
$d2=mysql_query("Select AVG(Q2_34)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_34'");
$row = mysql_fetch_array($la);
$m34=$row['j'];
// echo $array;
break;
break;
case q2_35:
$d2=mysql_query("Select AVG(Q2_35)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_35'");
$row = mysql_fetch_array($la);
$m35=$row['j'];
// echo $n;
break;
case q2_36:
$d2=mysql_query("Select AVG(Q2_36)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_36'");
$row = mysql_fetch_array($la);
$m36=$row['j'];
// echo $n;
break;
case q2_37:
$d2=mysql_query("Select AVG(Q2_37)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_37'");
$row = mysql_fetch_array($la);
$m37=$row['j'];
// echo $n;
break;
case q2_38:
$d2=mysql_query("Select AVG(Q2_38)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_38'");
$row = mysql_fetch_array($la);
$m38=$row['j'];
// echo $n;
break;
case q2_39:
$d2=mysql_query("Select AVG(Q2_39)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_39'");
$row = mysql_fetch_array($la);
$m39=$row['j'];
// echo $n;
break;
case q2_40:
$d2=mysql_query("Select AVG(Q2_40)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_40'");
$row = mysql_fetch_array($la);
$m40=$row['j'];
// echo $n;
break;
case q2_41:
$d2=mysql_query("Select AVG(Q2_41)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_41'");
$row = mysql_fetch_array($la);
$m41=$row['j'];
// echo $n;
break;
case q2_42:
$d2=mysql_query("Select AVG(Q2_42)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_42'");
$row = mysql_fetch_array($la);
$m42=$row['j'];
// echo $n;
break;
case q2_43:
$d2=mysql_query("Select AVG(Q2_43)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_43'");
$row = mysql_fetch_array($la);
$m43=$row['j'];
// echo $n;
break;
case q2_44:
$d2=mysql_query("Select AVG(Q2_44)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_44'");
$row = mysql_fetch_array($la);
$m44=$row['j'];
// echo $n;
break;
case q2_45:
$d2=mysql_query("Select AVG(Q2_45)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_45'");
$row = mysql_fetch_array($la);
$m45=$row['j'];
// echo $n;
break;
case q2_46:
$d2=mysql_query("Select AVG(Q2_46)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_46'");
$row = mysql_fetch_array($la);
$m46=$row['j'];
// echo $n;
break;
case q2_47:
$d2=mysql_query("Select AVG(Q2_47)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_47'");
$row = mysql_fetch_array($la);
$m47=$row['j'];
break;
}
switch($f){
case q2_1:
$imp=mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_1' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_2:
$imp = mysql_query("Select Factorscore From variables_and_factorscores Where Variable='Q2_2' AND Year='2010' AND Month='April'");
$row = mysql_fetch_array($imp);
$fa=$row['Factorscore'];
//echo $fa;
break;
case q2_3:
$imp =mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_3' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_4:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_4' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_5:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_5' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_6:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_6' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_7:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_7' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_8:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_8' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_9:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_9' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_10:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_10' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_11:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_11' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_12:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_12' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_13:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_13' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_14:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_14' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_15:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_15' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_16:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_16' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_17:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_17' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_18:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_18' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_19:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_19' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_20:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_20' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_21:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_21' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_22:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_22' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_23:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_23' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_24:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_24' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_25:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_25' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_26:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_26' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_27:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_27' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_28:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_28' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_29:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_29' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_30:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_30' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
case q2_31:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_31' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_32:
$imp = mysql_query("Select Factorscore as aa ,Varience as b From variables_and_factorscores Where Variable='Q2_32' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_33:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_33' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_34:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_34' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_35:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_35' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_36:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_36' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_37:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_37' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_38:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_38' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_39:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_39' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_40:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_40' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_41:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_41' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_42:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_42' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_43:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_43' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_44:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_44' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_45:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_45' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_46:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_46' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_47:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_47' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
}
//---------------------------------------------
switch($f){
case q2_1:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_1' AND Year='2010' AND Month= 'April'");
$row3 = mysql_fetch_array($imp2);
$va=$row3['b'];
break;
case q2_2:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_2' AND Year='2010' AND Month= 'April'");
$row3 = mysql_fetch_array($imp2);
$va=$row3['b'];
break;
case q2_3:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_3' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_4:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_4' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_5:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_5' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
// echo $n;
break;
case q2_6:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_6' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
// echo $n;
break;
case q2_7:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_7' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_8:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_8' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_9:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_9' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_10:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_10' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_11:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_11' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_12:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_12' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_13:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_13' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_14:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_14' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_15:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_15' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_16:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_16' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_17:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_17' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_18:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_18' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_19:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_19' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_20:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_20' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_21:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_21' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_22:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_22' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_23:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_23' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_24:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_24' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_25:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_25' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_26:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_26' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_27:
$imp2=mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_27' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_28:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_28' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_29:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_29' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_30:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_30' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
case q2_31:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_31' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_32:
$imp2 = mysql_query("Select Factorscore as aa ,Varience as b From variables_and_factorscores Where Variable='Q2_32' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_33:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_33' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_34:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_34' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
break;
case q2_35:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_35' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_36:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_36' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_37:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_37' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_38:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_38' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_39:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_39' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_40:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_40' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_41:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_41' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_42:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_42' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_43:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_43' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_44:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_44' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_45:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_45' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_46:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_46' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_47:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_47' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
}
//++++++++++++++++++++++++++++++++++++++++++++++++
if($w==0){
$e1=$n;
$ary0[$k0]=$e1;
$sn=$sn+$e1;
// echo $ar[$w];
$lb0[$k0]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx0[$k0]=$imm2;
$sum0=$sum0+$imm2;
$k0++;
}
elseif($w==1){
$e2=$n;
$ary1[$k1]=$e2;
$sn1=$sn+$e2;
// $lb1[$k1]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx1[$k1]=$imm2;
$sum1=$sum1+$imm2;
$k1++;
}
elseif($w==2){
$e3=$n;
$ary2[$k2]=$e3;
$sn2=$sn2+$e2;
// $lb2[$k2]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx2[$k2]=$imm2;
$sum2=$sum2+$imm2;
$k2++;
}
elseif($w==3){
$e4=$n;
$ary3[$k3]=$e4;
$sn3=$sn3+$e2;
// $lb3[$k3]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx3[$k3]=$imm2;
$sum3=$sum3+$imm2;
$k3++;
}
elseif($w==4){
$e5=$n;
$ary4[$k4]=$e5;
$sn4=$sn4+$e2;
// $lb4[$k4]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx4[$k4]=$imm2;
$sum4=$sum4+$imm2;
$k4++;
}
elseif($w==5){
$e6=$n;
$ary5[$k5]=$e6;
$sn5=$sn5+$e2;
// $lb5[$k5]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx5[$k5]=$imm2;
$sum5=$sum5+$imm2;
$k5++;
}
elseif($w==6){
$e7=$n;
$ary6[$k6]=$e7;
$sn6=$sn6+$e2;
// $lb6[$k6]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx6[$k6]=$imm2;
$sum6=$sum6+$imm2;
$k6++;
}
elseif($w==7){
$e8=$n;
$ary7[$k7]=$e8;
$sn7=$sn7+$e2;
// $lb7[$k7]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx7[$k7]=$imm2;
$sum7=$sum7+$imm2;
$k7++;
}
elseif($w==8){
$e9=$n;
$ary8[$k8]=$e9;
$sn8=$sn8+$e2;
// $lb8[$k8]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx8[$k8]=$imm2;
$sum8=$sum8+$imm2;
$k8++;
}
} //while
$v++;
//$w++;
}//do
while($v<10);
$tot_length=($ar_length1+$ar_length2+$ar_length3+$ar_length4+$ar_length5+$ar_length6+$ar_length7+$ar_length8+$ar_length9);
// echo $tot_length;
$totimp=($sum0+$sum1+$sum2+$sum3+$sum4+$sum5+$sum6+$sum7+$sum8);
// echo $totimp;
$meanimp=$totimp/$tot_length;
$tot_avg=($sn+$sn1+$sn2+$sn3+$sn4+$sn5+$sn6+$sn7+$sn8);
// echo $tot_avg;
//echo "gfdgf";
$meansat=$tot_avg/$tot_length;
// echo $meansat;
// echo $meanimp;
# Create a XYChart object of size 600 x 300 pixels, with a light blue (ccccff)
# background, a black border, and 1 pixel 3D border effect
$dis = array($m1,$m2,$m3,$m4,$m5,$m6,$m7,$m8,$m9,$m10,$m11,$m12,$m13,$m14,$m15,$m16,$m17,$m18,$m19,$m20,$m21,$m22,$m23,$m24,$m25,$m26,$m27,$m28,$m29,$m30,$m31,$m32,$m33,$m34,$m35,$m36,$m37,$m38,$m39,$m40,$m41,$m42,$m43,$m44,$m45,$m46,$m47);
$c = new XYChart(750, 600);
$c->addTitle("Quadrant Analysis", "timesbi.ttf", 18);
# Add a title box to the chart using 16 pts Arial Bold Italic font, with white text
# on deep blue background
/*$textBoxObj = $c->addTitle("Quadrant Analysis", "arialbi.ttf", 16,0xffffff);
$textBoxObj->setBackground(0x000080);*/
# Set the plotarea at (20, 60) and of size 560 x 360 pixels, with grey (808080)
# border, and light grey (c0c0c0) horizontal and vertical grid lines. Set 4 quadrant
# coloring, where the colors of the quadrants alternate between lighter and deeper
# grey (dddddd/eeeeee)
$plotAreaObj = $c->setPlotArea(40, 70, 560, 300, -1, -1, 0x808080, 0xc0c0c0, 0xc0c0c0
);
//$plotAreaObj->set4QBgColor(0xdddddd, 0xeeeeee, 0xdddddd, 0xeeeeee);
# Set 4 quadrant mode, with both x and y axes symetrical around the origin
//$c->setAxisAtOrigin(XYAxisAtOrigin, XAxisSymmetric + YAxisSymmetric);
# Add a legend box at (300, 460) (bottom center of the chart) with horizontal layout.
# Use 8 pts Arial Bold font.
//$legendBox = $c->addLegend(300, 540, false, "arialbd.ttf", 8);
//$legendBox->setAlignment(BottomCenter);
# Set legend box background to light grey (dddddd) with a black border
//$legendBox->setBackground(0xdddddd, 0);
# Set left/right margin to 20 pixels and top/bottom margin to 5 pixels
//$legendBox->setMargin2(20, 20, 5, 5);
# Add a titles to axes
//$c->xAxis->setTitle("Potential advantages");
//$c->yAxis->setTitle("Strategic advantages");
# Set axes width to 2 pixels
$c->xAxis->setWidth(2);
$c->yAxis->setWidth(2);
$c->xAxis->setTitle("Importance (%)", "arialbi.ttf", 10);
$c->yAxis->setTitle("Satisfaction (Score 1 Very bad - 5 Very good)", "arialbi.ttf", 10);
# Add a vertical brown (0x995500) mark line at x = 18
$xMark = $c->xAxis->addMark($meanimp, 0x995500);
# Add a vertical brown (0x995500) mark line at x = 18
$yMark = $c->yAxis->addMark($meansat, 0x995500);
//$yMark = $c->yAxis->addMark(80, 0xff0000, "Critical Threshold Set Point");
# Add scatter layer, using 15 pixels red (ff33333) X shape symbols
$c->addScatterLayer($arx0, $ary0, "Economy", CircleSymbol, 15, 0xff3333);
# Add scatter layer, using 15 pixels blue (3333ff) triangle symbols
$c->addScatterLayer($arx1, $ary1, "Healthy LifeStyle", CircleSymbol, 15,0x33ff33);
# Add scatter layer, using 15 pixels green (33ff33) 6-sided polygon symbols
$c->addScatterLayer($arx2, $ary2, "Urban Growth", CircleSymbol, 15,0x0066CC);
# Add scatter layer, using 15 pixels blue (3333ff) triangle symbols
$c->addScatterLayer($arx3, $ary3, "Transport", CircleSymbol, 15, 0xCCCC00);
$c->addScatterLayer($arx4, $ary4, "Crime & Saftey", CircleSymbol, 15, 0x993399);
# Add scatter layer, using 15 pixels blue (3333ff) triangle symbols
$c->addScatterLayer($arx5, $ary5, "Community", CircleSymbol, 15, 0x0099CC);
# Add scatter layer, using 15 pixels green (33ff33) 6-sided polygon symbols
$c->addScatterLayer($arx6, $ary6, "Environment", CircleSymbol, 15, 0x996600);
$c->addScatterLayer($arx7, $ary7, "Education", CircleSymbol, 15, 0xCCCCCC);
# Add scatter layer, using 15 pixels green (33ff33) 6-sided polygon symbols
$c->addScatterLayer($arx8, $ary8, "Public Health", CircleSymbol, 15, 0x663333);
$c->addExtraField($dis);
title='{dsField0}: ({xLabel}, {value})';
//$toolTip = "title='{xLabel}: US\\$ {value|0}M'";
# Output the chart
//header("Content-type: image/png");
//print($c->makeChart2(PNG));
?> |
| |
Re: tool tip problems |
Posted by Peter Kwan on Feb-02-2011 01:15 |
|
Hi M_jay,
For your case, there are many scatter layers, and each layer has a number of points. To use custom tooltips, please add the custom tooltips to the layer. It is like:
$layer = $c->addScatterLayer($myDataX0, $myDataY0, ...);
$layer->addExtraField($myToolTips0);
The $myDataX0, $myDataY0 and $myToolTips0 are the x-coordinates, y-coordinates and the tooltips of your data points.
If you have multiple layers, please repeat the above code, using different arrays for the x-coordinates, y-coordinates and the tooltips.
The chart output code is like:
# Create the image and save it in a temporary location
$chart1URL = $c->makeSession("chart1");
# Create an image map for the chart
$imageMap = $c->getHTMLImageMap("", "", "title='{field0}'");
?>
<html>
<body>
<img src="getchart.php?<?php echo $chart1URL?>" border="0" usemap="#map1">
<map name="map1">
<?php echo $imageMap?>
</map>
</body>
</html>
Please remember to copy "getchart.php" to the same directory as your code.
Hope this can help.
Regards
Peter Kwan |
Re: tool tip problems |
Posted by M_jay on Feb-02-2011 10:56 |
|
thanks Peter.I did it and saw tool tips as I wanted.but have a problem I want to display my chart on separate page.I have wrote html code for it.(MainQudrant.html)
I want to give my chart file name for this tag <img src="Qua_Analysis_Default.php"/>
Qua_Analysis_Default.php includes Code of my chart
I have put "getchart.php" to the same directory as my code.
When I opened (MainQudrant.html) file it displays broken image symbol with buttons but when I opened Qua_Analysis_Default.php separately it displayed my chart with tool tips.
(MainQudrant.html) code
<HTML>
<head>
</head>
<body>
<img src="Qua_Analysis_Default.php"/>
<table>
<tr>
<td>
<form action="Seg_main3.php" method="POST">
<input type="submit" name="Submit" value="January" />
<input type="submit" name="Submit" value="February" />
<input type="submit" name="Submit" value="March" />
<input type="submit" name="Submit" value="April" />
<input type="submit" name="Submit" value="May" />
<input type="submit" name="Submit" value="June" />
<input type="submit" name="Submit" value="July" />
<input type="submit" name="Submit" value="August" />
<input type="submit" name="Submit" value="September" />
<input type="submit" name="Submit" value="October" />
<input type="submit" name="Submit" value="November" />
<input type="submit" name="Submit" value="December" />
</form>
</td></tr>
</table>
</body>
</html>
Qua_Analysis_Default.php |
---|
<?php
require_once("C:/xampp/php/ext/phpchartdir.php");
$con = mysql_connect("localhost:3306","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mygraphs", $con);
$v=1;
$k0=0;
$k1=0;
$k2=0;
$k3=0;
$k4=0;
$k5=0;
$k6=0;
$k7=0;
$k8=0;
$sn0=0;
$sn1=0;
$sn2=0;
$sn3=0;
$sn4=0;
$sn5=0;
$sn6=0;
$sn7=0;
$sn8=0;
$ab=0;
Do{
switch($v){
case 1:
$d1="Select Variable From factor Where FactorName='Economy' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Economy' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length1 =$row['c'];
break;
case 2:
$w++;
$d1="Select Variable From factor Where FactorName='HealthyLifestyle' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='HealthyLifestyle' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length2 =$row['c'];
break;
case 3:
$w++;
$d1="Select Variable From factor Where FactorName='Urban Growth' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Urban Growth' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length3 =$row['c'];
break;
case 4:
$w++;
$d1="Select Variable From factor Where FactorName='Transport' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Transport' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length4 =$row['c'];
break;
case 5:
$w++;
$d1="Select Variable From factor Where FactorName='Crime & Safety' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Crime & Safety' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length5 =$row['c'];
break;
case 6:
$w++;
$d1="Select Variable From factor Where FactorName='Commiunity ' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Commiunity' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length6 =$row['c'];
break;
case 7:
$w++;
$d1="Select Variable From factor Where FactorName='Environment' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Environment' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length7 =$row['c'];
break;
case 8:
$w++;
$d1="Select Variable From factor Where FactorName='Education' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Education' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length8 =$row['c'];
break;
case 9:
$w++;
$d1="Select Variable From factor Where FactorName='Health' AND Year='2010' AND Month= 'April'";
$rd1 = mysql_query($d1);
$dd1="Select COUNT(Variable) as c From factor Where FactorName='Health' AND Year='2010' AND Month= 'April'";
$rdd1 = mysql_query($dd1);
$row = mysql_fetch_array($rdd1);
$ar_length9 =$row['c'];
break;
} //end sw
$sum = 0;
while($row = mysql_fetch_array($rd1))
{
$f = $row['Variable'] ;
switch($f){
case q2_1:
$d2 = mysql_query("Select AVG(Q2_1) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_1'");
$row = mysql_fetch_array($la);
$m=$row['j'];
break;
case q2_2:
$d2 = mysql_query("Select AVG(Q2_2) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_2'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $m;
break;
case q2_3:
$d2=mysql_query("Select AVG(Q2_3) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_3'");
$row = mysql_fetch_array($la);
$m=$row['j'];
break;
case q2_4:
$d2=mysql_query("Select AVG(Q2_4) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_4'");
$row = mysql_fetch_array($la);
$m=$row['j'];
break;
case q2_5:
$d2=mysql_query("Select AVG(Q2_5) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_5'");
$row = mysql_fetch_array($la);
$m=$row['j'];
break;
case q2_6:
$d2=mysql_query("Select AVG(Q2_6) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_6'");
$row = mysql_fetch_array($la);
$m=$row['j'];
break;
case q2_7:
$d2=mysql_query("Select AVG(Q2_7) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
// echo $n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_7'");
$row = mysql_fetch_array($la);
$m=$row['j'];
break;
case q2_8:
$d2=mysql_query("Select AVG(Q2_8) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_8'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_9:
$d2=mysql_query("Select AVG(Q2_9) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_9'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_10:
$d2=mysql_query("Select AVG(Q2_10) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_10'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_11:
$d2=mysql_query("Select AVG(Q2_11) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_11'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_12:
$d2=mysql_query("Select AVG(Q2_12) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_12'");
$row = mysql_fetch_array($la);
$m12=$row['j'];
// echo $n;
break;
case q2_13:
$d2=mysql_query("Select AVG(Q2_13) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_13'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_14:
$d2=mysql_query("Select AVG(Q2_14) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_14'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_15:
$d2=mysql_query("Select AVG(Q2_15) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_15'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_16:
$d2=mysql_query("Select AVG(Q2_16) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_16'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_17:
$d2=mysql_query("Select AVG(Q2_17) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_17'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_18:
$d2=mysql_query("Select AVG(Q2_18) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_18'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_19:
$d2=mysql_query("Select AVG(Q2_19) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_19'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_20:
$d2=mysql_query("Select AVG(Q2_20) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_20'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_21:
$d2=mysql_query("Select AVG(Q2_21) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_21'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_22:
$d2=mysql_query("Select AVG(Q2_22) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_22'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_23:
$d2=mysql_query("Select AVG(Q2_23) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_23'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $array;
// echo $n;
break;
case q2_24:
$d2=mysql_query("Select AVG(Q2_24) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_24'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_25:
$d2=mysql_query("Select AVG(Q2_25) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_25'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_26:
$d2=mysql_query("Select AVG(Q2_26) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_26'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_27:
$d2=mysql_query("Select AVG(Q2_27) as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_27'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_28:
$d2=mysql_query("Select AVG(Q2_28)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_28'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_29:
$d2=mysql_query("Select AVG(Q2_29)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_29'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_30:
$d2=mysql_query("Select AVG(Q2_30)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_30'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
case q2_31:
$d2=mysql_query("Select AVG(Q2_31)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_31'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_32:
$d2=mysql_query("Select AVG(Q2_32)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_32'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_33:
$d2=mysql_query("Select AVG(Q2_33)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_33'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_34:
$d2=mysql_query("Select AVG(Q2_34)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_34'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $array;
break;
break;
case q2_35:
$d2=mysql_query("Select AVG(Q2_35)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_35'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_36:
$d2=mysql_query("Select AVG(Q2_36)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_36'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_37:
$d2=mysql_query("Select AVG(Q2_37)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_37'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_38:
$d2=mysql_query("Select AVG(Q2_38)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_38'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_39:
$d2=mysql_query("Select AVG(Q2_39)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_39'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_40:
$d2=mysql_query("Select AVG(Q2_40)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_40'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_41:
$d2=mysql_query("Select AVG(Q2_41)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_41'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_42:
$d2=mysql_query("Select AVG(Q2_42)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_42'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_43:
$d2=mysql_query("Select AVG(Q2_43)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_43'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_44:
$d2=mysql_query("Select AVG(Q2_44)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_44'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_45:
$d2=mysql_query("Select AVG(Q2_45)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_45'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_46:
$d2=mysql_query("Select AVG(Q2_46)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_46'");
$row = mysql_fetch_array($la);
$m=$row['j'];
// echo $n;
break;
case q2_47:
$d2=mysql_query("Select AVG(Q2_47)as a From var_ratings Where Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($d2);
$n=$row['a'];
$array[]=$n;
$la=mysql_query("Select Label as j from variable_labels where Variable='Q2_47'");
$row = mysql_fetch_array($la);
$m=$row['j'];
break;
}
switch($f){
case q2_1:
$imp=mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_1' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_2:
$imp = mysql_query("Select Factorscore From variables_and_factorscores Where Variable='Q2_2' AND Year='2010' AND Month='April'");
$row = mysql_fetch_array($imp);
$fa=$row['Factorscore'];
//echo $fa;
break;
case q2_3:
$imp =mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_3' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_4:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_4' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_5:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_5' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_6:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_6' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_7:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_7' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_8:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_8' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_9:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_9' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_10:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_10' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_11:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_11' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_12:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_12' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_13:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_13' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_14:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_14' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_15:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_15' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_16:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_16' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_17:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_17' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_18:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_18' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_19:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_19' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_20:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_20' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_21:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_21' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_22:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_22' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_23:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_23' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_24:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_24' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_25:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_25' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_26:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_26' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_27:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_27' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_28:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_28' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_29:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_29' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_30:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_30' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
case q2_31:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_31' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_32:
$imp = mysql_query("Select Factorscore as aa ,Varience as b From variables_and_factorscores Where Variable='Q2_32' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_33:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_33' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_34:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_34' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_35:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_35' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_36:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_36' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_37:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_37' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_38:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_38' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_39:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_39' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_40:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_40' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_41:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_41' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_42:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_42' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_43:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_43' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_44:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_44' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_45:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_45' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_46:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_46' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
case q2_47:
$imp = mysql_query("Select Factorscore as aa From variables_and_factorscores Where Variable='Q2_47' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp);
$fa=$row['aa'];
break;
}
//---------------------------------------------
switch($f){
case q2_1:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_1' AND Year='2010' AND Month= 'April'");
$row3 = mysql_fetch_array($imp2);
$va=$row3['b'];
break;
case q2_2:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_2' AND Year='2010' AND Month= 'April'");
$row3 = mysql_fetch_array($imp2);
$va=$row3['b'];
break;
case q2_3:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_3' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_4:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_4' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_5:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_5' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
// echo $n;
break;
case q2_6:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_6' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
// echo $n;
break;
case q2_7:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_7' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_8:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_8' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_9:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_9' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_10:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_10' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_11:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_11' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_12:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_12' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_13:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_13' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_14:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_14' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_15:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_15' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_16:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_16' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_17:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_17' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_18:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_18' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_19:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_19' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_20:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_20' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_21:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_21' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_22:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_22' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_23:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_23' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_24:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_24' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_25:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_25' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_26:
$imp2= mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_26' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_27:
$imp2=mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_27' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_28:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_28' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_29:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_29' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_30:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_30' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
case q2_31:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_31' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_32:
$imp2 = mysql_query("Select Factorscore as aa ,Varience as b From variables_and_factorscores Where Variable='Q2_32' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_33:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_33' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_34:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_34' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
break;
case q2_35:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_35' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_36:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_36' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_37:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_37' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_38:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_38' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_39:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_39' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_40:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_40' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_41:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_41' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_42:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_42' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_43:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_43' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_44:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_44' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_45:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_45' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_46:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_46' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
case q2_47:
$imp2 = mysql_query("Select Varience as b From variables_and_factorscores Where Variable='Q2_47' AND Year='2010' AND Month= 'April'");
$row = mysql_fetch_array($imp2);
$va=$row['b'];
break;
}
//++++++++++++++++++++++++++++++++++++++++++++++++
if($w==0){
$e1=$n;
$ary0[$k0]=$e1;
$sn=$sn+$e1;
// echo $ar[$w];
$lb0[$k0]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx0[$k0]=$imm2;
$sum0=$sum0+$imm2;
$k0++;
}
elseif($w==1){
$e2=$n;
$ary1[$k1]=$e2;
$sn1=$sn+$e2;
$lb1[$k1]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx1[$k1]=$imm2;
$sum1=$sum1+$imm2;
$k1++;
}
elseif($w==2){
$e3=$n;
$ary2[$k2]=$e3;
$sn2=$sn2+$e2;
$lb2[$k2]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx2[$k2]=$imm2;
$sum2=$sum2+$imm2;
$k2++;
}
elseif($w==3){
$e4=$n;
$ary3[$k3]=$e4;
$sn3=$sn3+$e2;
$lb3[$k3]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx3[$k3]=$imm2;
$sum3=$sum3+$imm2;
$k3++;
}
elseif($w==4){
$e5=$n;
$ary4[$k4]=$e5;
$sn4=$sn4+$e2;
$lb4[$k4]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx4[$k4]=$imm2;
$sum4=$sum4+$imm2;
$k4++;
}
elseif($w==5){
$e6=$n;
$ary5[$k5]=$e6;
$sn5=$sn5+$e2;
$lb5[$k5]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx5[$k5]=$imm2;
$sum5=$sum5+$imm2;
$k5++;
}
elseif($w==6){
$e7=$n;
$ary6[$k6]=$e7;
$sn6=$sn6+$e2;
$lb6[$k6]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx6[$k6]=$imm2;
$sum6=$sum6+$imm2;
$k6++;
}
elseif($w==7){
$e8=$n;
$ary7[$k7]=$e8;
$sn7=$sn7+$e2;
$lb7[$k7]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx7[$k7]=$imm2;
$sum7=$sum7+$imm2;
$k7++;
}
elseif($w==8){
$e9=$n;
$ary8[$k8]=$e9;
$sn8=$sn8+$e2;
$lb8[$k8]=$m;
$fa1=$fa;
$va1=$va;
$imm1=$fa1*$fa1;
$imm2=$imm1*$va;
// echo $imm2;
// echo "<br/>"; //$ay[]
$arx8[$k8]=$imm2;
$sum8=$sum8+$imm2;
$k8++;
}
} //while
$v++;
//$w++;
}//do
while($v<10);
$tot_length=($ar_length1+$ar_length2+$ar_length3+$ar_length4+$ar_length5+$ar_length6+$ar_length7+$ar_length8+$ar_length9);
// echo $tot_length;
$totimp=($sum0+$sum1+$sum2+$sum3+$sum4+$sum5+$sum6+$sum7+$sum8);
// echo $totimp;
$meanimp=$totimp/$tot_length;
$tot_avg=($sn+$sn1+$sn2+$sn3+$sn4+$sn5+$sn6+$sn7+$sn8);
// echo $tot_avg;
//echo "gfdgf";
$meansat=$tot_avg/$tot_length;
// echo $meansat;
// echo $meanimp;
# Create a XYChart object of size 600 x 300 pixels, with a light blue (ccccff)
# background, a black border, and 1 pixel 3D border effect
/*$dis = array($m1,$m2,$m3,$m4,$m5,$m6,$m7,$m8,$m9,$m10,$m11,$m12,$m13,$m14,$m15,$m16,$m17,$m18,$m19,$m20,$m21,$m22,$m23,$m24,$m25,$m26,$m27,$m28,$m29,$m30,$m31,$m32,$m33,$m34,$m35,$m36,$m37,$m38,$m39,$m40,$m41,$m42,$m43,$m44,$m45,$m46,$m47);*/
$c = new XYChart(750, 600);
$c->addTitle("Quadrant Analysis", "timesbi.ttf", 18);
# Add a title box to the chart using 16 pts Arial Bold Italic font, with white text
# on deep blue background
/*$textBoxObj = $c->addTitle("Quadrant Analysis", "arialbi.ttf", 16,0xffffff);
$textBoxObj->setBackground(0x000080);*/
# Set the plotarea at (20, 60) and of size 560 x 360 pixels, with grey (808080)
# border, and light grey (c0c0c0) horizontal and vertical grid lines. Set 4 quadrant
# coloring, where the colors of the quadrants alternate between lighter and deeper
# grey (dddddd/eeeeee)
$plotAreaObj = $c->setPlotArea(40, 70, 560, 300, -1, -1, 0x808080, 0xc0c0c0, 0xc0c0c0
);
//$plotAreaObj->set4QBgColor(0xdddddd, 0xeeeeee, 0xdddddd, 0xeeeeee);
# Set 4 quadrant mode, with both x and y axes symetrical around the origin
//$c->setAxisAtOrigin(XYAxisAtOrigin, XAxisSymmetric + YAxisSymmetric);
# Add a legend box at (300, 460) (bottom center of the chart) with horizontal layout.
# Use 8 pts Arial Bold font.
//$legendBox = $c->addLegend(300, 540, false, "arialbd.ttf", 8);
//$legendBox->setAlignment(BottomCenter);
# Set legend box background to light grey (dddddd) with a black border
//$legendBox->setBackground(0xdddddd, 0);
# Set left/right margin to 20 pixels and top/bottom margin to 5 pixels
//$legendBox->setMargin2(20, 20, 5, 5);
# Add a titles to axes
//$c->xAxis->setTitle("Potential advantages");
//$c->yAxis->setTitle("Strategic advantages");
# Set axes width to 2 pixels
$c->xAxis->setWidth(2);
$c->yAxis->setWidth(2);
$c->xAxis->setTitle("Importance (%)", "arialbi.ttf", 10);
$c->yAxis->setTitle("Satisfaction (Score 1 Very bad - 5 Very good)", "arialbi.ttf", 10);
# Add a vertical brown (0x995500) mark line at x = 18
$xMark = $c->xAxis->addMark($meanimp, 0x995500);
# Add a vertical brown (0x995500) mark line at x = 18
$yMark = $c->yAxis->addMark($meansat, 0x995500);
//$yMark = $c->yAxis->addMark(80, 0xff0000, "Critical Threshold Set Point");
# Add scatter layer, using 15 pixels red (ff33333) X shape symbols
$layer =$c->addScatterLayer($arx0, $ary0, "Economy", CircleSymbol, 15, 0xff3333);
$layer->addExtraField($lb0);
# Add scatter layer, using 15 pixels blue (3333ff) triangle symbols
$layer =$c->addScatterLayer($arx1, $ary1, "Healthy LifeStyle", CircleSymbol, 15,0x33ff33);
$layer->addExtraField($lb1);
# Add scatter layer, using 15 pixels green (33ff33) 6-sided polygon symbols
$layer =$c->addScatterLayer($arx2, $ary2, "Urban Growth", CircleSymbol, 15,0x0066CC);
$layer->addExtraField($lb2);
# Add scatter layer, using 15 pixels blue (3333ff) triangle symbols
$layer =$c->addScatterLayer($arx3, $ary3, "Transport", CircleSymbol, 15, 0xCCCC00);
$layer->addExtraField($lb3);
$layer =$c->addScatterLayer($arx4, $ary4, "Crime & Saftey", CircleSymbol, 15, 0x993399);
$layer->addExtraField($lb4);
# Add scatter layer, using 15 pixels blue (3333ff) triangle symbols
$layer =$c->addScatterLayer($arx5, $ary5, "Community", CircleSymbol, 15, 0x0099CC);
$layer->addExtraField($lb5);
# Add scatter layer, using 15 pixels green (33ff33) 6-sided polygon symbols
$layer =$c->addScatterLayer($arx6, $ary6, "Environment", CircleSymbol, 15, 0x996600);
$layer->addExtraField($lb6);
$layer =$c->addScatterLayer($arx7, $ary7, "Education", CircleSymbol, 15, 0xCCCCCC);
$layer->addExtraField($lb7);
# Add scatter layer, using 15 pixels green (33ff33) 6-sided polygon symbols
$layer =$c->addScatterLayer($arx8, $ary8, "Public Health", CircleSymbol, 15, 0x663333);
$c->addExtraField($lb8);
# Create the image and save it in a temporary location
$chart1URL = $c->makeSession("chart1");
# Create an image map for the chart
$imageMap = $c->getHTMLImageMap("", "", "title='{field0}'");
?>
<html>
<body>
<img src="getchart.php?<?php echo $chart1URL?>" border="0" usemap="#map1">
<map name="map1">
<?php echo $imageMap?>
</map>
</body>
</html>
<!--//title='{dsField0}: ({xLabel}, {value})';
//$toolTip = "title='{xLabel}: US\\$ {value|0}M'";
# Output the chart
//header("Content-type: image/png");
//print($c->makeChart2(PNG));
--> |
| |
Re: tool tip problems |
Posted by Peter Kwan on Feb-02-2011 11:34 |
|
Hi M_jay,
According to the HTML standard, if you just use something like <img src="Qua_Analysis_Default.php"/>, then it cannot contain any tooltip and the image is not clickable. (You may refer to the HTML documentation for details.)
To make the image clickable, instead of using <img src="Qua_Analysis_Default.php"/>, please put the followings in your code:
<img src="getchart.php?<?php echo $chart1URL?>" border="0" usemap="#map1">
<map name="map1">
<?php echo $imageMap?>
</map>
Also, please rename your MainQudrant.html to MainQudrant.php, and put your charting code in MainQudrant.php. In this case, there is no need to have a separate file called Qua_Analysis_Default.php. Alternatively, you can put the PHP code in a separate file and use the PHP include statement to include them to MainQudrant.php.
Hope this can help.
Regards
Peter Kwan |
Re: tool tip problems |
Posted by M_jay on Feb-02-2011 12:58 |
|
My MainQuadrant.php page displays chart for default month April with 12 buttons for 12 months.
When I click on one of those buttons I want to display different chart according to the data of relevant month.
My Seg_Main3.php file I have assign $_POST['Submit'] value to xxx variable and I want pass xxx to the Qua_Analysis.php file.
I have used $month variable to store xxx(POST method result value) inside my Qua_Analysis.php file.
Seg_Main3.php file displays broken image symbol with 12 buttons.
I think xxx variable didnt assigned to the $month variable in Qua_Analysis.php file.
$month = $_GET["xxx"];
help me Peter
***************
I want to display labels ?Potential Vulnerabilities? in the first quarter, ?Key Vulnerabilities? in the second quarter, ?Strategic Advantages? in the third quarter and ?Potential Advantages? in the fourth quarter of my graph.
You can see my default chart :
http://www.ceylonpharmacy.com/Graphs/Qua_Analysis_Default.php
| | | | |
Seg_main3.php |
---|
<?php
include("Qua_Analysis.php");
?>
<html>
<body>
<table>
<tr><td> </td>
<td> </td>
<td> </td>
<td style="background-color:#FF0000" width="5" height="2">
Economy</td>
<td style="background-color:#009933" width="5" height="2">
HealthyLifestyle
</td>
<td style="background-color:#0066CC" width="5" height="2">
Urban Growth
</td>
<td style="background-color:#CCCC00" width="5" height="2">
Transport
</td>
<td style="background-color:#993399" width="5" height="2">
Crime&Safety
</td>
<td style="background-color:#0099CC" width="5" height="2">
Commiunity
</td>
<td style="background-color:#996600" width="5" height="2">
Environment
</td>
<td style="background-color:#CCCCCC" width="5" height="2">
Education
</td>
<td style="background-color:#663333">
Public Health
</td>
</td>
</table>
<img src="Qua_Analysis.php?xxx=<?php echo $_POST['Submit']?>">
<?php /*?><img src="getchart.php?<?php echo $chart1URL?xxx=<?php echo $_POST['Submit']?>>" border="0" usemap="#map1">
<map name="map1">
<?php echo $imageMap?>
</map>
<?php */?>
<form action="Seg_main3.php" method="POST">
<input type="submit" name="Submit" value="January" />
<input type="submit" name="Submit" value="February" />
<input type="submit" name="Submit" value="March" />
<input type="submit" name="Submit" value="April" />
<input type="submit" name="Submit" value="May" />
<input type="submit" name="Submit" value="June" />
<input type="submit" name="Submit" value="July" />
<input type="submit" name="Submit" value="August" />
<input type="submit" name="Submit" value="September" />
<input type="submit" name="Submit" value="October" />
<input type="submit" name="Submit" value="November" />
<input type="submit" name="Submit" value="December" />
</form>
</body>
</html> |
|
| | |
Re: tool tip problems |
Posted by Peter Kwan on Feb-03-2011 01:14 |
|
Hi M_jay,
According to PHP syntax, if you use the PHP function "include", the "Qua_Analysis.php" will automatically see all variables in the parent "Seg_Main3.php". There is nothing special you need to do. For more details on what is the purpose of PHP "include", please refer to your PHP documentation.
For example, in "Qua_Analysis.php", you can directly use the following code, because all variables in "Seq_Main3.php" is accessible from "Qua_Analysis.php".
$month = $_POST['Submit'];
For the chart output code, as explained in my previous email, please do not use an <img> tag. This is illegal in HTML for an <img> tag to reference a URL that produces something containing an image map. Please use the code I suggested in my previous message.
Also, for the "Qua_Analysis.php", please include only the PHP code, not the HTML code. (Remove all HTML code <html> .... </html> in "Qua_Analysis.php".) According to HTML standard, each web page should only contain one HTML tag. So it is illegal in HTML to include a file that contains the <html> tag, in another file that also contains an <html> tag.
Hope this can help.
Regards
Peter Kwan |
|