### Creating a chart report

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

1. Do either of the following to open the New Report dialog.
   - Click File > New > Report on the menu bar.
   - On the report tab bar, right-click the tab of an existing report in the report set and click Insert on the shortcut menu.
2. In the dialog, specify the title of the report, select the Chart Report layout and click OK. The Chart Report 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 according to your requirements.
   - To build the chart on an existing dataset in the report set, check the Existing radio button, and then select the dataset as required (click the Modify button to modify the selected dataset if necessary). You can also click the <Add Dataset...> item to create one as required.

   Note: If you want to create the chart on an HDS, pay attention to the unique features of HDS. For details, refer to Developing reports from HDS.

4. In the Type screen, specify the type of the chart according to your requirements.
   - 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. In the Display screen, add the required fields from the Resources panel to be displayed on the category (X) axis, series (Z) axis, and value (Y) axis of the chart, and define the sort order, special function and Select N condition of the fields if required.

   Notes:

   - If you specify to create a pie chart, you can add several fields to its value axis 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, you should add fields for the subtype in the order indicated by the subtype name, e.g., 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 .
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 as required.

   To define a filter condition, click the Add Condition button to add a condition line, then from the field drop-down list, select the field on which the filter will be based, set the operator with which to compose the filter expression from the operator drop-down list, and in the value combo box, type the value of how to filter the field or select the value from the drop-down list.

7. In the Layout screen, 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 according to your requirements. If you choose not to display a certain axis, the labels and tick marks along the axis will be hidden as well.
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.

See also:

- Chart Report Wizard for detailed explanation about options in this wizard.
- Charts for details about the chart component.

See 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`.