protovis part 5: swap external data

Swapping External data files

In this Protovis tutorial, we're going to change the bar chart that we made in the last tutorial into a line chart, swap external data files and build on the existing graphic. We're also going to use an animation technique to make it easier for users to interact with small visual elements like lines.

Lets start with a copy of the animated bar chart. In the head area, change "carace" to "stocks".

Open stocks.js. You can see that the structure is very similar to the carace file we used in the last exercise. Look at the values for each stock. notice that there are no decimals. We'll address this later. And notice that the data variable has changed from "popbyrace" to "stocks". Return to textmate and find and replace popbyrace with stocks in all instances and scroll back to the top.