Modifying Charts
For any chart in a report, you can further modify it at any time. For example you can change the data to display in the chart, bind links to the chart so as to open other targets from the chart at runtime, and so on.
This topic introduces modifying a chart as follows:
- Editing a Chart with Wizard
- Defining Special Groups
- Grouping Data by Intervals
- Setting Order/Select N Condition
Editing a Chart with Wizard
Once a chart has been created, you can further modify it by accessing its shortcut menu wizard which is composed by a set of screens that are similar to the wizard screens used to create the chart. For example, you can change the data used by the chart, modify the chart type, and so on.
- Right-click the chart and select Chart Wizard from the shortcut menu to display the Chart Wizard.
- In the Data screen, you can specify a new data source for the chart.
- In the Type screen, specify the type of the chart.
If you want to change the chart type, you may need to first remove all chart data. Specially, if you change a combo type to a single type or vice versa, Logi Report will prompt you to make sure because all chart data will be removed automatically.
- In the Display screen, specify the fields to be displayed on the chart. Use the button to replace a current field. For details about how to define a chart, see Inserting Charts in a Report.
- In the Layout screen, specify settings for the chart elements.
- In the Style screen, select a style for the chart.
- Select Finish to accept the changes.
Note: While changing a type of 2-D chart to another type of 2-D chart, or a type of 3-D chart to another type of 3-D chart, all the previous properties will be kept. Nevertheless, when changing a 2-D chart to a 3-D chart, the properties of the Z axis, the Y-Z wall, and the floor of the 3-D chart will be set to default values (since a 2-D chart does not have the Z axis, the Y-Z wall, or the floor), and all other properties will be taken from the 2-D chart. When changing a 3-D chart to a 2-D chart, the properties of the Y2 axis of the 2-D chart will be set to default values (since a 3-D chart does not have the Y2 axis).
Defining Special Groups
You can define how to group values on the category/series axis of a chart (for a heat map, on its groups). To do this:
- When creating or editing a chart with wizard, select the Special Group button in the Display screen. The User Defined Group dialog appears.
- Select the Add button to add a grouping line and specify the Group Name, Operator and Operand as required. Repeat this to add more group criteria.
For example, if you place a field named Score for grouping which contains student scores that range from 0 to 100, and you want to group the students in 5 ranks, namely rank A: 90~100, B: 80~89, C: 70~79, D: 60~69, and F: 0~59. You can set the groups as follows:
Group Name Operator Operand A between Op1: 90, Op2: 100 B between Op1: 80, Op2: 89 C between Op1: 70, Op2: 79 D between Op2: 60, Op2: 69 F <= 59 There will be five groups in the order from A to F. If you want to change the order of the groups, you can also do so via the User Defined Group dialog.
- Select Keep values outside of the range in special group checkbox if you want to put the values that are not included in the specified criteria in a new special group, and then provide a name for the special group in the Special Group Name text box.
- Select OK to accept the settings.
- When done, select Finish in the Chart Wizard to apply the changes.
Grouping Data by Intervals
For a chart that is created using a query resource in a page report, if the data type of the field displayed on the category/series axis of the chart (for a heat map, a group-by field) is of Numeric/String/Date/Time type, you can specify special functions to the field so as to group the corresponding data by intervals.
- When creating or editing a chart with wizard, select the Special Function button in the Display screen. The Special Function dialog appears.
- Select the special function for the category/series/group field from the Function drop-down list, then select OK.
- Select Finish in the Chart Wizard to apply the selected special function to the field.
- The special function for field on the category axis should be the same as that of the summary displayed on the value axis. If you add a summary with a special function to the value axis, the special function will be automatically applied to the field on the category axis and cannot be changed. If you want to apply a special function to the summary on the value axis, you should make sure the same special function is added to the category field as well. When the summary has no special function applied, you can add special function to the category field as you want.
- If you have defined a special function to the group-by field of a table or banded object, and insert a chart in the table or banded object which inherits dataset from the parent and has the same grouping structure with the parent, then when you view the report, you will find that the special function defined for the field will be applied to the chart too. However, you can specify another special function to the field on the chart axis according to your requirements.
- When both special functions and Select N conditions are defined in a chart, the former takes higher priority. That is to say, grouping data by intervals takes effect before Top/Bottom N.
Setting Order/Select N Condition
One of the most difficult problems with charts is when there are too many category or series values the chart becomes unreadable and also can become very slow to run, so you may want to show only specified category/series values in a chart and make the values sort according to a specified order. To achieve this, you can use the Order/Select N feature. By applying a Order/Select N condition to a chart, you can decide how many category/series values will be displayed in the chart and how the values will be sorted. You can even use an Integer-typed parameter to control the value of Select N. The Order/Select N feature works on the groups of heat maps as well.
- When creating or editing a chart with wizard, select the Order/Select N button in the Display screen.The Category Options/Series Options/Group Options dialog appears.
- In the Category Order/Series Order/Group Order box of dialog, specify the sort order of the category/series/group values.
- Ascend
Values will be sorted in an ascending order. - Descend
Values will be sorted in a descending order. - No Sort
Values will not be sorted and appear in the original order from the database.
- Ascend
- Specify the Select condition to All, Top N or Bottom N.
- All
If selected, all category/series/group values will be shown in the chart. - Top/Bottom N
If selected, the combo box to the right will be enabled and you can specify an integer number in the text box, or select a parameter which returns an integer from the drop-down list to dynamically define the Top/Bottom N condition, then only the first or last N (N is the number you specify by the integer or parameter) category/series/group values will be shown in the chart.Note: If you use an Integer-typed parameter to define the Top/Bottom N condition dynamically at runtime, you should make sure that the parameter has at least one default value that is larger than 0, otherwise you will get exceptions when viewing the report.
- All
- Select the Based On checkbox and specify values for the options that follow.
If Based On is unselected, all category/series/group values or its first/last N values will be sorted in the order you specify in the Category/Series/Group Order box of the dialog; if you select it, you can make the values sorted based on a field added to the value axis of the chart and select a radio button next to the Based On drop-down list to specify the sort order as you want. When Custom Sort is selected from the Based On drop-down list, you can customize the fields based on which to sort the values and set the sort order for each sort-by field using the Custom Sort dialog.
- If you have selected Top N or Bottom N from the Select drop-down list, you can select the Remaining Categories In checkbox and then type a character string in the text box to the right, so that the category/series/group values beyond the first or last N range will be merged into the group with the name as that character string.
- If you are specifying the Order/Select N condition for the category field, you can also select Overall Series to specify to calculate the top or bottom N category values based on the series values.
- You can select Skip First and type a number M in the text box to the right, then the first M category/series/group values will be skipped, and the Select N condition will begin with M+1. The skipped values will be merged into the Remaining Categories group.
- When done, select OK to accept the settings.
- Select Finish in the Chart Wizard to apply the changes.
The following example shows the usage of the Order/Select N feature on charts in detail.
- Make sure SampleReports.cat is the currently open catalog file. If not select File > Open Catalog to open it from
<install_root>\Demo\Reports\SampleReports
. - Select File > New > Web Report to create a web report.
- Insert a chart in the web report as follows:
- Use WorldWideSalesBV in Data Source 1 of the catalog as the data source.
- Display in the Clustered Bar 2-D chart type.
- Show Product ID on the category axis and Total Sales on the value axis.
- Apply the Classic style.
- Save the report and select the View tab to preview the chart. The chart appears as follows:
- Right-click the chart and select Chart Wizard from the shortcut menu to open the Chart Wizard.
- In the Display screen, select the Order/Select N button below the Category box.
- In the Category Options dialog, set the Select condition to Top 6, based on Total Sales descending, then select the Remaining Categories In checkbox and type Other in the text box so as to put the categories that do not meet the condition into the Other group. Select OK to accept the settings and leave the dialog.
- Select Finish in the Chart Wizard to finish editing the chart.
- Preview the chart again. It now shows as follows:
- Go back to the design mode and repeat step 5 to 7.
- In the Category Options dialog, select the Skip First checkbox and input 2 in the text box, then select OK.
- Select Finish in the Chart Wizard.
- Preview the chart and the result changes to below: