Using Angular for the gender filter and age filter
Refactored so that the formattedData object is in the scope of the plot directive rather than general controller