Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Power SIL Reporting Gadget allows users to write SIL code and use the predefined chart structures in order to generate line, bar, pie or doughnut charts.

...

Once you save the gadget configuration, the report will be displayed. 


Note

The script that you are using to generate the report needs to return the chart structure that you are building otherwise the report will throw an error.


If you want to return information about another project without having to configure the gadget, all you have to do is add a field for the project using one of the parameters routines for creating fields from gadget routines. After that you will be able to set parameter in the parameter section and run the report with the new value.

...

Code Block
number[] statusCount;

string [] issues = selectIssues("project = " + argv[0]);
for(string iss in issues) {
    string currStatus = iss.status;
    if(isNull(statusCount[currStatus])) {
        statusCount[currStatus] = 1;
    } else {
        statusCount[currStatus] += 1;
    }
}

SILReportingChartDataset datasets;
datasets.label = "Issues";
datasets.backgroundColor = {"#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"};
datasets.data = statusCount;

SILReportingChartData data;
data.labels = arrayKeys(statusCount);
data.datasets = {datasets};

SILReportingChartTitle title;
title.display = true;
title.text = "Issues in status";

SILReportingChartLegend legend;
legend.display = true;
legend.position = "top";

SILReportingChartOptions options;
options.title = title;
options.aspectRatio = 1.5;


SILReportingChart chart;
chart.type = argv[1]; //line, bar, pie, doughnut
chart.data = data;
chart.options = options;

silreporting_createAutocompleteSelectList("Project", {"TEST", "test", "test" , "FIBER", "FIBR", "fibr", "GERBEI", "GRBI", "grbi"}, "TEST");
silreporting_createSelectList("Chart Type", {"Line", "line", "line" , "Bar", "bar", "bar", "Pie", "pie", "pie", "Doughnut", "doughnut", "doughnut"}, "pie");

return chart;


Chart from JSON

In order to generate a chart report from a JSON file you have to :

...