Skip to content

Instantly share code, notes, and snippets.

@avasyukov
Created August 31, 2013 22:49
Show Gist options
  • Save avasyukov/6401143 to your computer and use it in GitHub Desktop.
Save avasyukov/6401143 to your computer and use it in GitHub Desktop.
// model.data will contain the data to be used for our report
model.data = [];
// Get managees of current user
var managees = orgchart.getPerson( person.properties.userName ).managees;
for each(var user in managees)
{
// Find how many nodes in repository has each managee created
var nodes = search.luceneSearch("-TYPE:\"cm:folder\" AND @modifier:" + user.getUserName() + "");
// Add one more item into report - 'x' is the object reported, 'y' is the value for this object
model.data.push( { "x": user.getUserName(), "y": nodes.length } );
}
// Configure captions
model.xCaption = 'User';
model.yCaption = 'Documents created';
model.xCaptionRotation = '60';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment