Changes

Jump to: navigation, search

Summarize iReport Template Data

6,417 bytes removed, 23:29, 21 September 2013
Grouped Bar Chart
===Modify Bar Charts===
 
===Grouped Bar Chart===
The horizontal axis of the bar charts discussed in the previous section compared the values of a single variable. For example, the bar chart below compares the number of different activity types.
 
[[Image:iRep34.png|center|500px|''Figure 34. Bar chart comparing values of a single variable'']]
<div align="center">
''Figure 34. Bar chart comparing values of a single variable''
</div>
 
In this section, you will learn how to create a grouped bar chart. A grouped bar chart compares the values of a single variable in one group to the same variables in another group. In the example below, the grouped bar chart still compares the number of activity types. However, the chart also compares the number of activity types between the districts. The number of activity types (clearance, impact survey, technical survey, and road clearance) are represented by the different bar colours as indicated in the legend. The coloured bars are clustered together based on their district. The first cluster of bars shows the number of activity in the Bolikon district. The second cluster of bars shows the number of activities in the Waltern district.
 
[[Image:iRep35.png|center|500px|''Figure 35. Grouped bar chart comparing values of a single variable'']]
<div align="center">
''Figure 35. Grouped bar chart comparing values of a single variable''
</div>
 
The two main differences between adding a bar chart and a grouped bar chart are:
*The grouped bar chart requires that you specify at least two groupings for the report.
*The key expression and the category expression will differ; whereas, for a bar chart, the value for these expressions is the same.
 
To add a grouped bar chart to the report:
<ol>
<li>Create a report which groups the results by the fields that will be represented on the horizontal axis of the chart.</li>
</ol>
 
{{note|For a grouped bar chart, you will need to specify at least two groupings.}}
 
<ol start="2">
<li>Add any variables that you may need to calculate the value that you would like to show on the chart.</li>
<li>If you would like to display the calculated variable for each group, you should add the footer for the field on which the results will be grouped. This footer will be used to display the variable for the group that will subsequently be used in the chart. To add a group footer:</li>
<ol type="a">
<li>From the '''View''' menu, select '''Bands'''.</li>
:The <FileName> bands… window displays.
<li>Select <''GroupFieldName''>Footer from the left pane where ''GroupFieldNameis'' the name of the field on which the results will be grouped. For example, if you are creating a report on land and group the results by the priority, the name of the band would be ''priorityFooter''.</li>
<li>In the right pane, enter a numeric value in the Band Height field. You may adjust the height of the summary.</li>
<li>Click the '''Apply''' button.</li>
<li>Add a summary section to the report.</li>
</ol>
<li>Click the [[Image:iRepBarChart.png]] icon.</li>
<li>In the summary section of the report, hold down the mouse button and drag the cursor to form the rectangle which will contain the chart.</li>
:A window of the various chart options displays.
<li>Select one of the bar chart options.</li>
</ol>
 
[[Image:iRep36.png|center|500px|''Figure 36. Bar chart options'']]
<div align="center">
''Figure 36. Bar chart options''
</div>
 
<ol start="8">
<li>Click the '''OK''' button.</li>
<li>Right-click anywhere on the chart.</li>
<li>select the '''Chart Properties''' option.</li>
<li>From the Chart Properties window, select the Chart Data tab.</li>
<li>From the Chart Data tab, select the Details tab.</li>
<li>Click the '''Add''' button.</li>
:The Chart Properties window displays. By default, the Data tab should be selected.
<li>For a grouped bar chart, the series expression contains the field whose distinct values you would like to show via different colours on the bar chart.</li>
</ol>
 
[[Image:iRep37.png|center|500px|''Figure 37. Bar chart series expression'']]
<div align="center">
''Figure 37. Bar chart series expression''
</div>
 
To enter the series expression:
<ol start="15">
<ol type="a">
<li>Click the [[Image:iRepEditor.png]] icon that is displayed beside the Key Expression field.</li>
:The Expression editor window displays.
<li>From the bottom pane, double-click the name of the field that contains the data that you would like to include in the chart.</li>
:The expression to represent the field displays in the top pane.
<li>Click the '''Apply''' button.</li>
</ol>
<li>The Category Expression is the field by which the series expression is grouped together.</li>
</ol>
 
[[Image:iRep38.png|center|500px|''Figure 38. Bar chart category expression'']]
<div align="center">
''Figure 38. Bar chart category expression''
</div>
 
To enter the category expression:
<ol start="16">
<ol type="a">
<li>Click the [[Image:iRepEditor.png]] icon that is displayed beside the Category expression field.</li>
:The Expression editor window displays.
<li>From the bottom pane, double-click the name of the field that contains the data that you would like to include in the chart.</li>
:The expression to represent the field displays in the top pane.
<li>Click the '''Apply''' button.</li>
</ol>
<li>The '''Value Expression''' field contains the variable that returns the numeric value that will be represented on the chart.</li>
<ol type="a">
<li>Click the [[Image:iRepEditor.png]] icon that is displayed beside the Value Expression field.</li>
:The Expression editor window displays.
<li>From the Objects and expressions tab, select '''Variables''' from the left pane.</li>
<li>From the middle pane at the bottom of the Expression editor window, double-click the name of the variable that you would like to represent on the chart.</li>
<li>Click the '''Apply''' button.</li>
</ol>
<li>Click the '''OK''' button.</li>
:The Chart Properties window closes.
<li>Click the '''Close''' button.</li>
:The Chart Properties window closes.
<li>Save the report by either clicking the [[Image:iRepSave.png]] icon, or by selecting the Save option from the '''File''' menu.</li>
</ol>
 
{{note|iReport requires you to save the report after adding or changing a chart.}}
 
<ol start="20">
<li>Click the [[Image:iRepCompile.png]] button to compile the report.</li>
<li>Click the [[Image:iRepRun.png]] button to execute the report.</li>
</ol>
 
{{NavBox HowTo use iReport}}
319
edits

Navigation menu