The report is a bar chart showing the number of opened issues vs number of resolved issues for a given list of projects.Â
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;
|