### Creating a chart report

Assume that you have already opened a page report, to create a chart report within it:

1. Do either of the following:
   - Click File > New > Page Report Tab on the menu bar.
   - On the report tab bar, right-click an existing report tab in the report and click Insert on the shortcut menu.
2. In the New Page Report Tab dialog, specify the title of the report tab, select the Chart layout and click OK. The Chart Wizard will then be displayed.
3. In the Data screen of the wizard, specify the dataset on which the chart will be built.
   - To build the chart on a new dataset created from the catalog resources, check the New radio button, and then select the data source of the dataset. If the given data resources are not what you want, click the <Add xxx...> item to create one. In addition, if you choose to create the dataset from a query, you can click the Modify button to further modify the query if required.
   - To build the chart on an existing dataset in the report, check the Existing radio button, and then select the dataset as required (click the Modify button to modify the selected dataset in the Dataset Editor if necessary). You can also click the <Add Dataset...> item to create one as required.
4. In the Type screen, specify the type of the chart.
   - To create a single type chart, check the Single Type radio button, and select the required type from the Chart Type box and its sub type accordingly.
   - To create a combo type chart, check the Combo Type radio button, and the click the <Add Combo Type> item to add the required combo type to Primary Axis and Secondary Axis respectively.
5. The Display screen varies with chart types:
   - For common chart types

     Add the required fields or additional values from the Resources box to be displayed on the category axis, series axis, and value axis of the chart, and define some special group, special function and Order/Select N condition on the category/series field if required.

     If you select the bubble chart type, you need to specify the fields to be shown on the bubble X axis, Y axis and the value you want to show as the bubble radius in the Show Values box. Note that when you specify a value for the bubble X axis, this value will be displayed on the category axis instead of the one specified in the Category box. However, the value defined in the Category box will also be included in data calculation.

   - For org chart
     1. Select a field from the Child drop-down list which defines the entities.
     2. Select a field from the Parent drop-down list which defines the ownership or reporting to relations among the entities. For example, if the child field is Employee ID, the parent field can be the one about IDs showing which employ ID reports to which employ ID. Note that the parent field should use different one from the child field.
     3. The Properties box displays a node model in the org chart. You can add objects, including data fields, labels and images, from the Resources box into the node and then adjust their positions and sizes in the node and the size of the node. Those added objects will be displayed in each node as the information about the entity members.
        - To add an object, dragging it from the Resources box and dropping to the specific position in the node area in the Properties box, or select it from the Resources box and then click .
        - To remove an object from the node, select it and then click or press Delete on the keyboard.

     For more information about this chart type, see Organization chart.

   - For heat map
     1. Add the fields used to group the data into the Groups box. Define some special group, special function and Order/Select N condition on the group field if required.
     2. Add proper summaries into the Summaries box.

        The summaries should match the groups. For example, if the groups level is A > B > C, the static summaries grouped by C can be inserted into the Summaries box, but the static summaries grouped by A, B or other fields cannot.

        If no group is specified in the Groups box, you can insert any static summary. And its group-by field will be inserted into the Groups box automatically.

     3. From both Groups and Summaries boxes, specify the fields to do color by and size by, and select the fields as label-by fields to display in the innermost rectangle in the heat map.

     For more information about this chart type, see Heat Map.

6. To apply some filters to the chart so as to reduce the data displayed in the chart, go to the Filter screen and define the filter conditions.
7. In the Layout screen,
   - For common chart types, with the Data category selected in the Options list box, you can specify the category/series start and end offset, whether or not to reverse the category/series field value sequence, and whether or not to swap groups. Besides, you can set whether or not to show the titles, axes, walls, gridlines, and legend. If yes, set the titles for the chart, the category axis and the value axis respectively. If you choose not to display a certain axis, the labels and tick marks along the axis will be hidden as well.
   - For organization chart, in the Type category, choose a way of expanding the org chart tree. Then configure the other settings if required.
   - For heat map, you can specify the chart title and whether to show the chart legend.
8. In the Style screen, specify the style of the chart, and if required, click the Page Setup button to set the page settings.
9. When done, click Finish to create the report tab.

Notes:

- When you want to create a chart report on a hierarchical data source, pay attention to the unique features of HDS. For details, refer to Developing reports from HDS.
- If you specify to create a pie chart, you can add several fields to be displayed on the value axis of the chart as long as the fields are of Numeric type. However, you can add formulas and DBFields to the axis at the same time, but when a summary has been added to the axis, no other DBFields or formulas can be added.
- If you have defined a subtype of the Stock type, in the Display screen, you should add fields for the subtype in the order indicated by the subtype name, for example, if you define the Open-High-Low-Close 2-D subtype, then you should add four fields to the Show Values box for this subtype, and arrange them to the order of Open-High-Low-Close by clicking the buttons and .

See also:

- Charts for details about the chart component.
- An example: The SampleComponents catalog, included with JReport Designer, contains reports that have examples of report layout types. For the chart report layout example, open `<install_root>\Demo\Reports\SampleComponents\Chart.cls`.