\r\n"; //echo "End date = ".$strEndDate."
\r\n"; $con=mysql_connect($servername,$username,$password) or die("Failed to connect with database!!!!"); mysql_select_db($dbname, $con); // The Chart table contains two fields: weekly_task and percentage // This example will display a pie chart. If you need other charts such as a Bar chart, you will need to modify the code a little to make it work with bar chart and other charts $sql = "CALL sp_GetTankChartData('".$strStartDate."','".$strEndDate."');"; $sth = mysql_query($sql); $rows = array(); $flag = true; $table = array(); $table['cols'] = array( // Labels for your chart, these represent the column titles // Note that one column is in "string" format and another one is in "number" format as pie chart only required "numbers" for calculating percentage and string will be used for column title array('label' => 'Time', 'type' => 'string'), array('label' => 'Distance from sensor in cm', 'type' => 'number') ); $rows = array(); while($r = mysql_fetch_assoc($sth)) { $temp = array(); // the following line will be used to slice the Pie chart $temp[] = array('v' => (string) $r['Period']); // Values of each slice $temp[] = array('v' => (int) $r['AvgDistance']); $rows[] = array('c' => $temp); } $table['rows'] = $rows; $jsonTable = json_encode($table); ?> SEPTIC.ESPICH.COM

SEPTIC.ESPICH.COM

Rasberry PI 3 powered septic tank dosing chamber level monitor with dosing pump control and Web Server.