Pie Chart

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

Report : A pie chart showing number of issue logged by its status in a Project (Name : Count of Defects By Status For A Project).

SQL Query

Count of Defects By Status For A Project

SELECT count(*) as "Issue Count", issues.issueStatus as "Issue Status" FROM issues WHERE issues.projectID in (`@Filter.project`) GROUP BY issues.issueStatus

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 Pie 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.