Create an array whichs contains each month and the count for the month starting with zero like this:
[ [1, 0], [2, 0], ..., [12, 0] ]
with this code:
var items = [];
for (var i = 1; i <= 12; i++)
items.push([i, 0]);
And then in your each
function use
items[n][1]++;
to increase the count for each occurence of the month n
in your table.
After that you can use your items
array to create a flot chart.