Why is my chart not populating?  I am trying to get data, create columns, 
loop through row creation, and display the data in a simple chart.  I can't 
see what is wrong here:

<!DOCTYPE html>

<html>

  <head>

    <!-- EXTERNAL LIBS-->

    <script 
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js";></script>

    <script src="https://www.google.com/jsapi";></script>

 

    <!-- EXAMPLE SCRIPT -->

    <script>

 

      // onload callback

      function drawChart() {

 

        // JSONP request

        var jsonData = $.ajax({

          url: 'https://www.quandl.com/api/v1/datasets/WSJ/FE_TJN.json',

          data: {page: 1},

          dataType: 'json',

        }).done(function (results) {

 

          var data = new google.visualization.DataTable();

 

          data.addColumn('datetime', 'Time');

          data.addColumn('number', 'Price');

       

 

          $.each(results, function (i, row) {

            data.addRow([

              (new Date(row.Date)),

              parseFloat(row.Value)

            ]);

          });

 

var chart = new google.visualization.LineChart($('#chart').get(0));

 

          chart.draw(data, {

            title: 'Prices'

          });

 

        });

 

      }

// load chart lib

      google.load('visualization', '1', {

        packages: ['corechart']

      });

 

      // call drawChart once google charts is loaded

      google.setOnLoadCallback(drawChart);

 

    </script>

 

  </head>

  <body>

    <div id="chart" style="width: 75%;"></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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/3c38eda3-c003-408e-9eec-70d359bd0fa4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to