Fixes issue with malformed chart titles with pie charts.

Closes #2205.

Adds a function that applies a formatter to the pie chart titles.