Display workload distribution across users.
Example Code#
function generateChart(api, params, context) {
const items = api.queryItems("type = 'task'");
const byUser = api.groupBy(items, 'assignee');
const labels = Object.keys(byUser);
const values = labels.map(u => byUser[u].length);
return echarts.createBarChart({
labels: labels,
values: values
}, {
title: 'User Workload',
xLabel: 'User',
yLabel: 'Tasks'
});
}
Full Example#
See source: source-files/02_user_workload_bar.js
Customization#
Filter by status:
const items = api.queryItems("type = 'task' status = 'open'");
See also: Scripted Charts Guide