Doughnut Chart

Doughnut charts are generated based on count for an entity. Let’s take an example of a Doughnut Chart report.

Report : Generate a chart that displays the Count of Issues logged, by their priority for a specific project (Name - Count of Defects By Priority For A Project).

SQL Query

Count of Defects By Priority For A Project

SELECT issues.priority as "Priority", count(1) as "Issue Count" FROM issues WHERE issues.projectID in (`@Filter.project`) GROUP BY issues.priority

Apply the Filter

Query Output

By default, it gives you output in tabular format. You can modify the output format by switching to the available chart types from the table. In our case, we will switch it to the Doughnut Chart.

You can adjust the Columns based on the requirement to the Label and Value sections.

  • Label always holds a single Test entity field with any value.

  • Value always holds a single Test entity field with any value (i.e. with numeric values).

Once you get your desired report, you can save the report as a Gadget by clicking on the Add Gadget button.

Once you save the gadget, it will be available in the QMetry Custom Gadget section > My Gadget tab.