I have a function that gets the number of submitted tickets for each user. How do I make this get the top five submitters (and their respective ticket totals) and lump the rest of the count into "other." This data is being pulled from a database. thanks!
--- You must not fight too often with one enemy, or you will teach him all your tricks of war.
Code:
var user_burt_count = [];
for ( var i=0; i < data.length; i++ ) {
var submitter = data[i].sub_by;
if( !( submitter in user_burt_count ) ) {
user_burt_count[submitter] = 1;
}
else {
user_burt_count[submitter]++;
}
}
--- You must not fight too often with one enemy, or you will teach him all your tricks of war.