PHP - Selecting Timestamp Date For Use In Google Annotation Chart
Following on from my problem with another Google Chart which jay0316 kindly helped with, I have another issue which I am hoping that someone might be able to help me with.
I am trying to put together a site for my wife to manage her diabetes and insulin intake. We want to monitor her blood/sugar glucose over periods of time (but with notes that she includes that can help monitor reasons for outlying results such as illness), so I am trying to include a Google Annotation Chart to do this, drawing on blood/glucose readings stored in a Database.
Where I am struggling at the moment is converting timestamps into information that I can include in the chart.
What I currently have at the moment (which obviously isn't working) is:
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['annotationchart']}]}"></script> <script type='text/javascript'> google.load('visualization', '1', {'packages':['annotationchart']}); google.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn('datetime', 'Date'); data.addColumn('number', 'Readings'); data.addColumn('string', 'Notes'); data.addRows([ <?php$annotate=DB::getInstance()->query("SELECT * FROM tabbyhealth WHERE reading!=0"); Similar TutorialsHi I'm using a the following google Pie Cart from here http://code.google.com/apis/ajax/playground/#pie_chart I would like to use php to COUNT printers listed in a column called machine and return result so I can echo it into google code Example of Column below would return a count of one for each except for the TurboJet which would return two. I would then like to echo the results to the google Javascript for printer 1 to 6. _______ machine ________ FB7500-1 TurboJet XL1500-1 Roland Canon TurboJet Can anyone help? Cheers Chris Code: [Select] <?php mysql_connect("localhost","chris","Cr2baxKUHWGxr6nn"); @mysql_select_db("schedule") or die( "Unable to select database"); date_default_timezone_set('Europe/London'); $query = "SELECT machine, COUNT(machine) FROM maindata GROUP BY machine"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo "There are is ". $row['COUNT(machine)'] ." ". $row['machine'] ." items."; echo "<br />"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title> Google Visualization API Sample </title> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1', {packages: ['corechart']}); </script> <script type="text/javascript"> function drawVisualization() { // Create and populate the data table. var data = new google.visualization.DataTable(); data.addColumn('string', 'Task'); data.addColumn('number', 'Hours per Day'); data.addRows(5); data.setValue(0, 0, 'Printer 1'); data.setValue(0, 1, 11); data.setValue(1, 0, 'Printer 2'); data.setValue(1, 1, 2); data.setValue(2, 0, 'Printer 4'); data.setValue(2, 1, 2); data.setValue(3, 0, 'Printer 5'); data.setValue(3, 1, 2); data.setValue(4, 0, 'Printer 6'); data.setValue(4, 1, 7); // Create and draw the visualization. new google.visualization.PieChart(document.getElementById('visualization')). draw(data, {title:"Current Work in Progress"}); } google.setOnLoadCallback(drawVisualization); </script> </head> <body style="font-family: Arial;border: 0 none;"> <div id="visualization" style="width: 600px; height: 400px;"></div> </body> </html> Good afternoon,
I am working on a project that gives the user a data table and a google chart (using the api) based on what the user selects for a <select> <option>.
Index.PHP code:
<form> <select name="users" onchange="showUser(this.value);drawChart();"> <option value=""> Select a Metal: </option> <?php //connection details $query = "SELECT TOP(31) tblMetalPrice.MetalSourceID, tblMetalSource.MetalSourceName from tblMetalPrice INNER JOIN tblMetalSource ON tblMetalPrice.MetalSourceID=tblMetalSource.MetalSourceID ORDER BY tblMetalPrice.DateCreated DESC "; $result = sqlsrv_query( $conn, $query); while( $row = sqlsrv_fetch_object ($result)) { echo "<option value='".$row->MetalSourceID ."'>". $row->MetalSourceName ."</option>"; } sqlsrv_close( $conn); ?> </select> </form> <div id="chart_div"></div> <div id="txtHint"><b>Past metal information will be generated below.</b></div>this works fine and generates the list in the select option dropdown Script to get table contents: <script> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","scripts/gettabledata001.php?q="+str,true); xmlhttp.send(); } </script>this also works fine and generates the table contents based on 'q' value from the select dropdown. Google API script: <script type="text/javascript"> // Load the Visualization API and the piechart,table package. google.load('visualization', '1', {'packages':['corechart']}); google.setOnLoadCallback(drawChart()); function drawChart() { var jsonData = $.ajax({ url: "scripts/getgraphdata.php", dataType:"json", data: "q="+num, async: false }).responseText; // Instantiate and draw our pie chart, passing in some options. var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(data, {width: 400, height: 240}); } </script>getgraphdata.php script: $q = intval($_GET['q']); ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(-1); $query ="SELECT TOP(30) tblMetalPrice.MetalSourceID, tblMetalPrice.DateCreated, tblMetalPrice.UnitPrice, tblMetalPrice.HighUnitPrice, tblMetalSource.MetalSourceName FROM tblMetalPrice INNER JOIN tblMetalSource ON tblMetalPrice.MetalSourceID = tblMetalSource.MetalSourceID WHERE tblMetalPrice.MetalSourceID = '".$q."' ORDER BY tblMetalPrice.DateCreated DESC"; $result = sqlsrv_query($conn, $query); echo "{ \"cols\": [ {\"id\":\"\",\"label\":\"Date\",\"pattern\":\"\",\"type\":\"string\"}, {\"id\":\"\",\"label\":\"Unit Price\",\"pattern\":\"\",\"type\":\"number\"} ], \"rows\": [ "; $total_rows = sqlsrv_num_rows($result); $row_num = 0; while($row = sqlsrv_fetch_object($result)){ $row_num++; if ($row_num == $total_rows){ echo "{\"c\":[{\"v\":\"" . $row->DateCreated->format('d-m-Y') ."\",\"f\":null},{\"v\":" . $row->UnitPrice . ",\"f\":null}]}"; } else { echo "{\"c\":[{\"v\":\"" . $row->DateCreated->format('d-m-Y') ."\",\"f\":null},{\"v\":" . $row->UnitPrice . ",\"f\":null}]}, "; } } echo " ] }"; sqlsrv_close( $conn);When ever i try these they don't work the getgraphdata.php scripts runs fine the issue I believe but may be totally wrong may be done to the google api script that should generate the chart but doesn't. Can anyone help here I've been trying to sort this for a few days now and losing confidence in myself rapidly. Thanks Kris Hello,
Newbie needs some help pls. Searched far and wide, seen others ask but no answer (maybe too obvious).
I have a simple function to do some basic math (its for young children)
<?php for($i=0;$i<$_POST['period'];$i++):
$year=$current_year+$i; I recently created a site that creates charts with google charts api and information it collects from a database that the owner of the site inputs. All works well except for the left and right axis top numbers. These display odd top numbers and I am wondering what it would take to get it to round the number up to the nearest 100 so that it displays evenly. I set the code to go 100 over and I think that somewhere in here is my problem. If a user inputs a number of 255 and that number is the highest within the chart data then the top number displays 355. It displays both top number 255 and 355. Now what this does is makes the gains look higher that they actually are because it goes from 200, 255 and then 355. Please see example out put here I am sure there must be away to dynamically add the axis labels without it pulling in the info from the data itself right? I have asked this very same question on google code and still know answer. Here is an example of the code I am using. <?php $id_entity = $_product->getId(); $chart_num_rows = 0; $db_obj = mysql_connect('localhost', 'XXX', 'XXX'); mysql_select_db('XXXX', $db_obj); $query = " SELECT a.frontend_label AS frontend_label, b.value AS value FROM XXX AS a, XXX AS b WHERE a.attribute_id = b.attribute_id && b.entity_id = ".$id_entity." && a.attribute_id BETWEEN 564 AND 568 ORDER BY a.attribute_id ASC "; $result = mysql_query($query); if(mysql_num_rows($result) != 0) { @$chart_num_rows = mysql_num_rows($result); } if($chart_num_rows != 0) { $max = 0; $min = 0; $array = array(); for($i = 0; $i < $chart_num_rows; $i++) { $row = mysql_fetch_object($result); $clean = str_replace(" ", '', $row->value); $explode = explode(',', $clean); if($i == 4) { $min = min($explode); $max = max($explode); } else { if($min < min($explode)) { $min = min($explode); } if($max < max($explode)) { $min = max($explode); } } $array[$i][0] = $row->frontend_label; /* Labels */ $array[$i][1] = $clean; /* Line Data */ $array[$i][2] = str_replace(',', '|', $clean); /* Labels */ } $count = 100; $left_right = ''; while($count < $max) { $left_right .= $count.'|'; $count = ($count + 100); } $left_right .= $max.'|'.($max + 100); $output = '<img src="http://chart.apis.google.com/chart? cht=lc&chd=t:'.$array[1][1].'|'.$array[2][1].'|'.$array[3][1].'|'. $array[4][1]; $output .= '&chls=3|3|3|3|3|3,6,3&chf=bg,s,FFFFFF&chxl=0:|'.$array[0] [2].'|1:|'.$left_right.'|2:|'.$left_right; $output .= '&chs=575x300&chf=bg,s,FFFFFF&chco=444444,444444,0000FF, 0000FF&chxt=x,y,r&chds=50,'.($max + 100); $output .= '&chm=h,76A4FB,0,0:1:.2,2,-1|V,76A4FB,0,::2,0.5,-1"><br / ><br />'; } else { $output = 'There are no current statistics available for this chart.'; } echo $output; ?> Hi guys, I'm putting together a small event system where I want the user to add his own date and time into a textfield (I'll probably make this a series of drop-downs/a date picker later). This is then stored as a timestamp - "0000-00-00 00:00:00" which displays fine until I try to echo it out as a UK date in this format - jS F Y, which just gives today's date but not the inputted date. Here's the code I have right now: Code: [Select] $result = mysql_query("SELECT * FROM stuff.events ORDER BY eventdate ASC"); echo "<br />"; echo mysql_result($result, $i, 'eventvenue'); echo ", "; $dt = new DateTime($eventdate); echo $dt->format("jS F Y"); In my mysql table eventdate is set up as follows: field - eventdate type - timestamp length/values - blank default - current_timestamp collation - blank attributes - on update CURRENT_TIMESTAMP null - blank auto_increment - blank Any help as to why this could be happening would be much appreciated, thanks. Hi, I have a table field that has the full timestamp (date and time), I want to select records from DB but after checking the date part only from the timestamp. Example: 2020-3-10 10:15:00 ---- i want to check if current date is equal to the date part which in this case it is the same. Thanks. Hi am trying to add date and timestamp of when a comment gets posted.Am not gr8t at php but still learning. If any one can help me on this would be reil gr8t. Sry for the long post. As for now i have this Code: [Select] $date = date("M j, y, g:i a"); and echo's out the date, time [/code]$date[/code] as in the current date and time which i dont want. Code: [Select] <?php $query = yasDB_select("SELECT * FROM newsblog"); if($query->num_rows == 0) { echo '<div id="newsblog_text">This news blog has no comments, become a member and be the first to add one!</div>'; } else { $query = yasDB_select("SELECT * FROM newsblog WHERE userid = '$id'"); while($row = $query->fetch_array(MYSQLI_ASSOC)) { $date = date("M j, y, g:i a"); $text = $row['comment']; $text = str_replace(':D','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/biggrin.gif" title="biggrin" alt="biggrin" />',$text); $text = str_replace(':?','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/confused.gif" title="confused" alt="confused" />',$text); $text = str_replace('8)','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/cool.gif" title="cool" alt="cool" />',$text); $text = str_replace(':cry:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/cry.gif" title="cry" alt="cry" />',$text); $text = str_replace(':shock:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/eek.gif" title="eek" alt="eek" />',$text); $text = str_replace(':evil:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/evil.gif" title="evil" alt="evil" />',$text); $text = str_replace(':lol:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/lol.gif" title="lol" alt="lol" />',$text); $text = str_replace(':x','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/mad.gif" title="mad" alt="mad" />',$text); $text = str_replace(':P','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/razz.gif" title="razz" alt="razz" />',$text); $text = str_replace(':oops:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/redface.gif" title="redface" alt="redface" />',$text); $text = str_replace(':roll:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/rolleyes.gif" title="rolleyes" alt="rolleyes" />',$text); $text = str_replace(':(','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/sad.gif" title="sad" alt="sad" />',$text); $text = str_replace(':)','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/smile.gif" title="smile" alt="smile" />',$text); $text = str_replace(':o','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/surprised.gif" title="surprised" alt="surprised" />',$text); $text = str_replace(':twisted:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/twisted.gif" title="twisted" alt="twisted" />',$text); $text = str_replace(':wink:','<img src="' . $siteurl . 'templates/' . $theme . '/styles/images/smileys/wink.gif" title="wink" alt="wink" />',$text); echo '<div class="newsblog_box1"><div class="newsblog_name">' . $row['name'] . ' '.$date.'</div></div> <div class="newsblog_box2">' . $text . '</div>'; } }?> I have a little problem with creating a timestamp and display it again with date () Here is a small shript: <?php $day = 6; $month = 7; $year = 1985; $ts = mktime($month, $day, $year); echo date("d-m-Y",$ts); ?> In my world would result in 6-7-1985 but instead I get 06-11-2010 Why .. what am I doing wrong? POSTBIL.COM I'm having a weird issue going on, I'm wondering if it has to do with my php.ini or server setup, anyway here is the code with the odly outcomes: Code: [Select] echo date('Y/m/d H:i:s', 2145000000); // 2037/12/21 01:20:00 echo date('Y/m/d H:i:s', 2149000000); // 1901/12/31 01:58:24 echo date('Y/m/d H:i:s', 2150000000); // 1902/01/11 15:45:04 It seems after year 2037 it goes down to 1900+... Why would this happen? I've tried on 2 godaddy servers and local host and all same result I want to convert a unix time stamp to the date format (dd/mm/yy). How can i be possible ? sorry, I know this is simple, but stuck on it... how would one go about converting 1/21/11 to a UNIX timestamp, something like 1293035229? and while we are at it, how to convert 1293035229 to 1/21/11 ? (i know the timestamp is wrong, just for example) thanks!!!!! Hi All, I am trying to pull a record from my table using the date of birth column (which is a date column) like so.. Code: [Select] $birthday = ('1936-08-21'); $query = "Select * from my_table where dob = $birthday"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)){ echo "Name is - " .$row['name']; } I know there is a record in the table with a date of birth(dob) value of 1936-08-21 but it does not return any records ? thanks for looking, Tony Hello I am getting an error in my php code. I think the error is in the first line of code but I am not 100% for sure. The error states... Notice: Undefined index: paid_date ... Can you tell me if I am going down the correct route to select the max date in a column? Code: [Select] [b]$query = "Select MAX(paid_date) as paidDate from players INNER JOIN players_paid ON players.player_number=players_paid.player_number"; $query = mysql_query($query) or die(mysql_error());[/b] /*SELECT column_name(s) FROM table_name1 INNER JOIN table_name2 ON table_name1.column_name=table_name2.column_name*/ //echo "SELECT 1 FROM players_paid WHERE (((players_paid.player_number)="+str_replace("'","''",$rsNewPlayer__ssPlayerNumber)+") AND ((players_paid.paid_type)=1))"; ?> <html> <body> <?PHP echo $user; ?> <br> <?php echo $password; ?> <br> <?PHP while($rows=mysql_fetch_assoc($query)) { ?> <table width="100%" border="1"> <tr> <th scope="col"><?PHP echo $rows['paid_date'] ?></th> </tr> </table> <?PHP } ?> </body> </html> I can't figure out how to select something from the database that is under today's date. This is what I have: if($row['date'] == ".date('Y-m-d').' 00:00:00'."' AND date < '".date('Y-m-d').' 23:59:59'.") Any help would be greatly appreciated. I have a simple mysql database holding information about an image upload including its 'name' and 'date uploaded' [current_timestamp()] to a folder 'image' I then display it into a table using the php ‘foreach’ facility. I want the date to be displayed in the ‘dd/mm/yyyy’ format. not the default yyyy/mm/dd. Here is the relevant code <?php $conn = mysqli_connect("localhost", "root", "", "dbname"); $results = mysqli_query($conn, "SELECT * FROM tablename"); $image = mysqli_fetch_all($results, MYSQLI_ASSOC); ?> <?php foreach ($image as $user): ?> <td><p>NAME</p><?php echo $user['name']; ?></td> <td><p>COMMENT</p><?php echo $user['comment']; ?></td> <td><p>DATE</p><?php echo $user['date']; ?></td> What do I need to do? THANKS- Warren Hi all
This is a one I've spent DAYS on and can't figure out :-\ This is for a wedding venue and their pricing schedule is divided into low, medium, high and very high seasons. I.e. low season runs from 8 Jan 16 to 28 Feb 16, medium runs from 4 Mar 16 to 20 Mar 16, etc. The database for this is laid out as attached. I would like people to be able to enter their arrival and departure date and for it to be able to choose which seasons the date range falls under. I.e. If they stay 8 to 12 Jan, that's no problem to calculate and falls under LOW season. However, if they stay 27 Feb to 10 Mar, this falls under both LOW and MID seasons, with the majority of the stay in the MID season (which we'd price with but can use PHP to choose the 'highest' season from the array). I'm a bit stumped on this one so any help is hugely appreciated! I'm sure it's something quite simple that I'm missing. Attached Files Screen Shot 2015-01-10 at 16.58.17.png 146.3KB 0 downloads SELECT * FROM `booking_tbl` WHERE booking_status = 'Check In' AND departure_date_time = NOW()"I use the datetime datatype for the departure_date_time so i can get data from that data because it checking the date and time but i want it to check on the date from the datetime datatype So how can i get the data only with that date without the time in the mysql datetime datatype <?php $url = "myurl"; $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_URL, $url); $getdata = curl_exec($curl); $data = json_decode($getdata); $users = $data->result[0]->Users; $datapoints = array(); foreach($users as $user): $dataPoints[] = array( 'label' => $user->UserObject->UserName, 'y' => $user->Amount); endforeach; echo "<pre>"; print_r($dataPoints); echo "</pre>"; echo json_encode($dataPoints, JSON_FORCE_OBJECT); ?> <!DOCTYPE HTML> <div class="container"> <h2>Chart.js — Pie Chart Demo</h2> <div> <canvas id="myChart"></canvas> </div> </div> <script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script> <script> var ctx = document.getElementById("myChart").getContext('2d'); var myChart = new Chart(ctx, { type: 'pie', data: { labels: "{label}", datasets: [{ backgroundColor: [ "#2ecc71", "#3498db", "#95a5a6", "#9b59b6", "#f1c40f", "#e74c3c", "#34495e" ], data: <?php echo json_encode($dataPoints, JSON_NUMERIC_CHECK); ?> }] } }); </script> <style> .container { width: 80%; margin: 15px auto; } </style> what is wrong? I can no longer see the chart. Json { "result": [ { "ID": 1, "Users": [ { "UserObject": { "UserName": "User1", "-": { "ID": 1 }, "0": "0" }, "User": "User1", "Amount": 57654456 }, { "UserObject": { "UserName": "User2", "-": { "ID": 1 }, "0": "0" }, "User": "User2", "Amount": 57654456 }, { "UserObject": { "UserName": "User3", "-": { "ID": 1 }, "0": "0" }, "User": "User3", "Amount": 57654456 } ], "Reached": false, "IsActive": true } ], "error": false, "version": 1 }
Hello, In a MySQL table I have the following rows: Item name Item price Milk 1.05 Butter 1.50 Lettuce 0.70 Butter 1.55 Bread 0.65 Chicken 3.50 Milk 1.00 Coca Cola 1.20 Apples 0.90 Toothpaste 1.00 Oranges 0.80 Milk 1.00 What I'm looking to do is collect all of the milks, all of the butters, etc and give a $total_price_spent_on value for each product, so for milk we'd have 3.05, for oranges we'd have 0.80, and so on until all items on the list have been totalled. Then I want to select the most expensive 3 totals, display them in a pie chart, and all other items to be listed under an "other" label. Any pointers as to how to go about this? Many thanks Am trying to query my DB and use the result to create a chart. code pasted below;
<?php $date = $_POST['Date']; //$date = '25/05/2010'; $date = str_replace('/', '-', $date); $new_date = date('Y-m-d', strtotime($date)); //echo $new_date; include('mysql_connect.php'); // Settings for the graph include "libchart/classes/libchart.php"; $chart = new VerticalBarChart(600, 520); $chart = new VerticalBarChart(); $dataSet = new XYDataSet(); $query1 = mysql_query ("select * from requisition where date = '$new_date' ") or die(mysql_error()); while($row = mysql_fetch_array($query1)) { //$amt = $row['amount']; // check each department and sum up all their data if ( $row['department'] = "ICT") { $total1 = $total1 + $row['amount']; //exit; } else if ( $row['department'] = "Supply Chain/ Asset Integrity") { $total2 = $total2 + $row['amount']; //exit; } else if ( $row['department'] = "Account") { $total3 = $total3 + $row['amount']; //exit; } else if ( $row['department'] = "Admin / Services ") { $total4 = $total4 + $row['amount']; //exit; } else if ( $row['department'] = "Business Development") { $total5 = $total5 + $row['amount']; //exit; } else if ( $row['department'] = "Manpower") { $total6 = $total6 + $row['amount']; //exit; } else if ( $row['department'] = "Maintenance") { $total7 = $total7 + $row['amount']; //exit; } else if ( $row['department'] = "HR") { $total8 = $total8 + $row['amount']; //exit; } else if ( $row['department'] = "Marine Logistics") { $total9 = $total9 + $row['amount']; //exit; } //$dataSet->addPoint(new Point($row['department'], $row['amount'])); } $dataSet->addPoint(new Point("ICT", $total1)); $dataSet->addPoint(new Point("Supply Chain", $total2)); $dataSet->addPoint(new Point("Account", $total3)); $dataSet->addPoint(new Point("Admin / Services", $total4)); $dataSet->addPoint(new Point("Business Development", $total5)); $dataSet->addPoint(new Point("Manpower", $total6)); $dataSet->addPoint(new Point("Maintenance", $total7)); $dataSet->addPoint(new Point("HR", $total8)); $dataSet->addPoint(new Point("Logistics", $total9)); $chart->setDataSet($dataSet); $chart->setTitle("Report By Date - $date"); $chart->render("generated/date.png"); header("Location: view_date.php"); //header ('lcoation : '); ?> ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: When i Try to view the result, it only displays the first one in the IF statement. please, what am i doing wrong? Thanks in advance |