protovis part 4: external data and animated labels

Add county labels

Now lets add county labels on the left. Copy the entire pv.Bar code and paste it above the original.

Change the left property to 0.

Change the fillStyle to null.

Change the anchor to left and labels are flush left on the page.

While this is a perfectly acceptable way to label a chart, we want the labels to hang off the bars.

First, delete the width property since we no longer need it.

Change left to 99.

Change anchor to right.

Change the anchor left property to 99.

In the text property, delete commas and change d.White to d.County.

Finally, change textStyle to "gray". This small design change makes the labels secondary and the data easier to read.

Everything should match the code below.