here is my code:
index.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SOME REAL TIME DATA PROJECT</title>

<link rel="stylesheet" type="text/css" 
href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.1/css/bulma.min.css";>
<link rel="stylesheet" type="text/css" href="myStyle.css">

<script type="text/javascript" 
src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.min.js";>
</script>

<script type="text/javascript" 
src="https://www.gstatic.com/charts/loader.js";></script>

<!--Load the AJAX API -->
<script type="text/javascript" src="http://www.google.com/jsapi";></script>
<script 
src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; 
type="text/javascript"></script>

<!--<script type="text/javascript" src="myScript.js"></script>
-->  
<script type="text/javascript">
function drawChart () {
var dataJSON = $.ajax({
url:"returnData.php",
dataType:"json",
async:false
}).responseText;

//Create our data table out of JSON data loaded from server
var data = new google.visualization.DataTable(dataJSON);
//PieCharts expects 2 columns of data: a label and a value, so we need to 
use a DataView to restrict to 2 columns
// var view = new google.visualization.DataView(data);
// view.setColumns([0, 3]);

//Instantiate and draw our chart, passing in some options
var chart = new 
google.visualization.LineChart(document.getElementById('linechart_div'));
chart.draw(data, {width:600, height:500});
}

//Load the visualization API and the piechart package
      google.charts.load('current', {'packages':['corechart']});

//Set a callback to run when the google visualization API is loaded
google.setOnLoadCallback(drawChart);


    </script>


</head>

<body>
       <nav class="nav">
                  <div class="nav-left" align="left">
                    <div align="center"><a class="nav-item">
                    Real Time Data Visualization
                    <img 
src="http://www.purchased.com/wp-content/uploads/2013/06/IconsCroppedRealtime-150x150.png";
 
alt="realtime logo">
                    </a></div>
                  </div>
                  
                  <div class="nav-center" align="center">
                    <a class="nav-item">
                    
                    </a>
                </div>
                  
                  <div class="nav-right nav-menu">
            <a class="nav-item">
              Home
            </a>
            <a class="nav-item">
              Documentation
            </a>
            <a class="nav-item">
              Contact Us
            </a>
            </div>
                  
       </nav>
                <div class="columns">
                
                    <div class="column" id="linechart_div">
                    </div>
                    
    
                    
                    <div class="column" id="barchart_div">
                    </div>
                    
                    
</div>




</body>
<footer class="footer">
  <div class="container">
    <div class="content has-text-centered">
      <p>
        Real Time Data Coding Test 
        
      </p>
      
    </div>
  </div>
</footer>
</html>




On Monday, May 29, 2017 at 8:36:30 PM UTC+3, Hussam wrote:
>
> I am unable to figure out what the issue is, i am using a (free web-host) 
> service, everything seems to go fine from retrieving data from the database 
> to getting json. but when i try to draw the chart, nothing displays at all.
>
>
>
>

-- 
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/64f5c8bc-81f4-4eee-ba8b-9a6a734c00d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to