protovis part 3: variables and animation

Adding Labels

Now lets add some labels to the chart. Put cursor after the lineWidth value, hit return and type .anchor("center"). This will anchor each label to the center of it's wedge.

Next, type .add(pv.Label). Notice that labels appear in the chart but they rotate around its center. To make them all horizontal, hit return and type .textAngle(0) Hit return and type .textStyle("white") so they are easier to see. hit return and type .font("bold 10pt sans-serif") and end the chain with a semicolon.