Your code uses jqplot, not the Visualization API (which is what this group 
is about).  You will likely be able to find help with this on 
stackoverflow.com

On Thursday, October 23, 2014 9:05:18 PM UTC-4, Lim Jing Xiang wrote:
>
> <html>
> <head>
> <script language="javascript" type="text/javascript" 
> src="js/jquery1.6.1.min.js"></script>
> <script language="javascript" type="text/javascript" 
> src="js/jquery.barchart.min.js"></script>
> <script language="javascript" type="text/javascript" 
> src="js/categoryAxisRenderer.min.js"></script>
> <script language="javascript" type="text/javascript" 
> src="js/pointLabels.min.js"></script>
> <script type="text/javascript">
>
> <?php
> $dataArray = array(); 
>  $con=mysqli_connect("localhost","root","","hotel_administration");
>  //1
> $result = mysqli_query($con,"SELECT COUNT(*) FROM stock_details");
> $row = mysqli_fetch_array($result);
> $NumProducts = $row[0];
> $dataArray[] = "['Products', ".$NumProducts."]";
>  //2
> $result = mysqli_query($con,"SELECT COUNT(*) FROM stock_sales"); //edit 
> sql here
> $row = mysqli_fetch_array($result);
> $Numtemp = $row[0];
> $dataArray[] = "['Sales Transactions', ".$Numtemp."]"; 
>  //2
> $result = mysqli_query($con,"SELECT COUNT(*) FROM purchaseorder where 
> status='waiting'"); //edit sql here
> $row = mysqli_fetch_array($result);
> $NumSup = $row[0];
> $dataArray[] = "['Purchase orders', ".$NumSup."]"; 
>  //2
> $result = mysqli_query($con,"SELECT COUNT(*) FROM customer_details"); 
> //edit sql here
> $row = mysqli_fetch_array($result);
> $NumCus = $row[0];
> $dataArray[] = "['Customers', ".$NumCus."]"; 
>  $line = implode (", ", $dataArray);
> ?>
> $(document).ready(function(){
> $.jqplot.config.enablePlugins = true;
> var line1 = [<?php echo $line;?>];
>  $('#chart1').jqplot([line1], {
> title:' ',
> seriesDefaults:{
> renderer:$.jqplot.BarRenderer,
> rendererOptions: {
> varyBarColor: true
> }
> },
> axes:{
> xaxis:{
> renderer: $.jqplot.CategoryAxisRenderer,
> }
> }
> });
> });
> </script>
> </head>
> <body>
> <div id="chart1"></div>
> </body>
> </html>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to