string [] projects = argv[0];
int [] resolvedIssues;
int [] openedIssues;
for(string p in projects) {
resolvedIssues += countIssues("project = " + p + " AND status in (Done, Closed, Resolved)");
openedIssues += countIssues("project = " + p + " AND status not in (Done, Closed, Resolved)");
}
SILReportingChartDataset openedDataset;
openedDataset.label = "Opened Issues";
openedDataset.backgroundColor = {"#3cba9f", "#3cba9f", "#3cba9f", "#3cba9f", "#3cba9f","#3cba9f"};
openedDataset.data = openedIssues;
SILReportingChartDataset resolvedDataset;
resolvedDataset.label = "Resolved Issues";
resolvedDataset.backgroundColor = {"#3e95cd", "#3e95cd", "#3e95cd", "#3e95cd", "#3e95cd", "#3e95cd"};
resolvedDataset.data = resolvedIssues;
SILReportingChartData data;
data.labels = projects;
data.datasets = {openedDataset, resolvedDataset};
SILReportingChartTitle title;
title.display = true;
title.position = "top";
title.text = "Opened vs Resolved Issues Report";
SILReportingChartLegend legend;
legend.display = true;
legend.position = "top";
SILReportingChartTicks ticks;
ticks.beginAtZero = true;
SILReportingChartYAxes yAxes;
yAxes.ticks = ticks;
SILReportingChartScales scales;
scales.yAxes = {yAxes};
SILReportingChartOptions options;
options.title = title;
options.legend = legend;
options.scales = scales;
options.aspectRatio = 1.5;
SILReportingChart barChart;
barChart.type = "bar";
barChart.data = data;
barChart.options = options;
return barChart;
|