Let us see how easy it is to represent data in charts.
What You Will Learn
This tutorial guides you through the steps to create a report with Chart data region.
Note: This tutorial uses shared data set - SalesByRegion. The shared data sets and shared data sources can be viewed or modified in the Administrator Dashboard. For information on adding shared data sets, see
Tutorial 7.1: Add Shared Data Set.
After you complete this tutorial, you will have a report that looks similar to the following.
![](images/chart-preview.png)
Access the ActiveReports Web Designer and Add Data Set
- On the ActiveReports Server Report Portal, click Create report.
The ActiveReports Web Designer opens in the new browser tab.
- From top right corner of the Web Designer, click Data icon
.
- Click Add and then from the shared data sets available, select SalesByRegion.
- Click Add. The SalesByRegion data set is added to the report.
Create Report Layout
The report uses the Chart data region to display data. Drag and drop the Chart data region
onto the design area of the report.
![](images/chart-draganddrop.png)
The default chart type is Column Plain. You can change the chart type from the Type property.
Bind Data to Chart
We will create a chart with two series plotted along the Y-axis.
- From the fields available in the data set, drag the Store field into the Category Fields area. This automatically binds the Store field to the X axis.
- Drag the Profit and the Quantity field into the Data Fields area. This plots the Profit and Quantity fields to the Y axis of the chart.
![](images/chart-binddata.png)
Note that the Data Set Name property of the chart is already set to SalesByRegion data set.
Add Y2 Axis
- From the Explorer
, select the Chart data region.
- In the Value Axes field, click Show Items. You will see that Y1 axis is already added.
- Click Add Item. The Y2 axis is added to the chart.
- To bind the Quantity field to Y2 axis, select Quantity in the Data Fields area and change the Value Axis Name property to Y2.
Add Titles
Let us add titles to our chart, and to the X and Y axes.
- From the Explorer
, select Title under Chart1 (or the name of your chart).
![](images/chart-explorer-title.png)
- From the Properties pane, set Caption to Store Summary.
- In the Explorer, select the Category Axis > Title and set Caption to Store Name.
- In the Explorer, select the Value Axis Y1 > Title and set Caption to Profit.
- In the Explorer, select the Value Axis Y2 > Title and set Caption to Quantity.
- In the Explorer, select Legend and under Layout, set Position to TopCenter.
![](images/chart-addtitle.png)
Customize the Appearance of the Chart Report
Let us now customize the appearance of chart and its labels and axes.
Note: You may need to resize the Chart data region on the report to accommodate data, and for a cleaner look.
-
To sort the order for the stores displayed on X axis in the ascending order,
- Select Chart1_CategoryGroup1 in the Category Fields area.
- In the Properties pane, go to the Sort Expressions field.
- Click Show Items and then Add Item.
- Click the radio button and select Store from the list of data set fields.
The default sort order is ascending order.
To define the Y axes that will be displayed on the chart,
- Select chart.
- In the Value Axes field, click
next to Y2. The Axis Properties pane is displayed.
- Set the Location property of Y2 axis to Right.
To define the data fields for the type of chart that they will display,
- Select Profit in the Data Fields area.
- From the Properties pane, set Type to Line Plain.
- Select Quantity in the Data Fields area.
- From the Properties pane, set Type to Area Plain.
To change the color of chart,
- Select the chart on the design area of the report.
- Under the Properties tab, set Palette to Excel.
![](images/chart-design-customize.png)
Preview and Save Report
- Click Preview
to view your report in the final output.
- Exit the preview mode by clicking Back on the top left side of the designer.
- Switch to the File tab and click Save to open the Save dialog box. Enter the report name and click Save Report. You can also provide a description and a revision comment for the report.