title: Dynamically loading external data from database into d3.js
body: <p>I am trying to get dynamic reloading to work in d3 and I'm having trouble trying to figure out how to refresh the data from the database.</p>
  
  <p>I have an array that contains values should change every second:</p>
  
  <blockquote>
    <p>var data = [1,2,3,4];</p>
  </blockquote>
  
  <p>In my initial script, I had PHP pull the data from the database to set up the array, and reloading the page works fine for that, but I'd like to use d3's reload functionality to fetch new data and redraw the diagram.</p>
  
  <p>I'm completely new to js and d3, so any suggestions would be very helpful.</p>
  
  <p>I tried using jQuery's get command to call an external PHP script that outputs the values but that doesn't seem to work.</p>
  
  <p>I'm basically trying to replicate the bar chart from Google Analytics real time display.</p>