3.5. Report with Chart Output

Using the report wizard, you can create reports with chart output in the same way as any other report types. The only difference is that you will need to configure the chart template after finishing the report in the wizard.

This example is based on the petclinic application, which source code is available at GitHub.

  1. Add the Charts addon to your project via CUBA Add-Ons window as described in the Studio documentation.

  2. Start creating a report as described in the previous chapters.

    chart wizard
    Figure 25. Chart Template in Wizard – Step 1
  3. For the chart report, select countable entity attributes – they will be later used for the value axis.

    chart wizard 2
    Figure 26. Chart Template in Wizard – Select Attributes
  4. Complete the next step of the report creation.

    chart wizard 3
    Figure 27. Chart Template in Wizard – Step 2
  5. At the last step, select the chart type – either Pie or Serial – and save the report.

    chart wizard 4
    Figure 28. Chart Template in Wizard – Step 3
  6. Finally, configure the chart axis on the Templates tab of the report editor.

    chart wizard 5
    Figure 29. Chart Template Configuration

    For more details on charts configuration, see the Charts documentation.