title: Using JSON file data in Chart.js
body: <p>pretty new to javascript.
  Im trying to read a JSON file located on my localhost (<a href="http://localhost:8080/jsonData.json" rel="nofollow">http://localhost:8080/jsonData.json</a>) and format it to be displayed using Chart.js.
  <br></p>
  
  <p>Here is my JSON File:</p>
  
  <pre><code>[{"date": "1/02/16", "price":15.25},
  {"date":"29/01/16", "price":15.35},
  {"date":"28/01/16", "price":15.1}]
  </code></pre>
  
  <p>and my html file which will display the chart:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Test Chart&lt;/title&gt;
  &lt;script src="javascript/Chart.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;canvas id="mycanvas" width="400" height="400"&gt;&lt;/canvas&gt;
  &lt;script&gt;
  $.getJSON( "http://localhost:8080/jsonData.json", function( data ) {
      var chartjsData = [];
      var labels = [];
      $.each( data, function( key, val ) {
          labels.push(key);
          chartjsData.push(val);
        });
  
      var lineChartData = {
          labels : labels,
          datasets : [{
              fillColor : "rgba(220,280,220,0.5)",
              strokeColor : "rgba(220,220,220,1)",
              data : chartjsData
          }]
      };
      var myLine = new Chart(document.getElementById("mycanvas").getContext("2d")).Line(lineChartData);
  });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>basically when i run it i just get a blank screen with nothing displayed so I'm guessing its something to do with how I'm parsing the file, any help would be appreciated.</p>