Tuesday, 25 March 2014

D3 video tutorial 10 - loading external data...

Data not normally hard coded.

Load external files.

Stored in the same folder as the index.html

Fetching data:
depends on the format:
json format -
d3.json("mydata.json", function (data) {code}

First argument is the path to the file.
Second argument - what must happen once the data is loaded.
   - this will be a function - "call back function"
   - all the code that depends on the data should be stored here!


Some good information here.

How to add text to our bar chart is covered and merits some revisiting.





No comments:

Post a Comment