[]
This walkthrough creates a Pie Chart. The chart shows how the total sales amount is divided between different product categories such as cameras, computers, cell phones, TV and video, and audio. Each slice in the chart represents the percentage values that each part of the category contributes. The final chart appears like this:
In the ActiveReports Designer, create a new RDLX report and follow the New Report wizard to bind the report to data. You can also perform data binding later using the Report Data Source dialog accessed from the Report Explorer.
In the Dataset dialog, select the General page and enter the name of the dataset, 'FactSales'.
Go to the Query page and enter the following query to fetch the required fields:
$.value[*]
Go to the Fields page to view the available fields. On the same page, add following calculated field:
Name | Value |
---|---|
Product Category | =Switch([ProductKey] < 116, "Audio", [ProductKey] >= 116 And [ProductKey] < 338, "TV and Video", [ProductKey] >= 338 And [ProductKey] < 944, "Computers", [ProductKey] >= 944 And [ProductKey] < 1316, "Cameras", [ProductKey] >= 1316, "Cell Phones") |
Click OK to save the changes.
We will use the Chart Wizard dialog to configure chart data values. The wizard appears by default if you have a dataset added to your report. See the topic on Chart Wizard for more information.
Drag-drop Chart data region onto the design area. The New Chart dialog appears with an option to select the query and the plot type.
Select the Query as the dataset name (FactSales) and the Plot Type as 'Column'.
Click Next to configure data values.
Here, we will define two series values to form a cluster (or group), one column to show the 'Net Sales' and the other to show the 'Net Income'.
Under Configure Chart Data Values, add the following data value and click Next.
Field | Aggregate | Caption |
---|---|---|
[SalesAmount] | Sum | Sales Amount |
In the Configure Chart Data Groupings, set the Series > Group By to [Product Category].
Click Next and Choose Report Colors from Theme and Style, and preview your chart.
Now that the basic structure of your chart is ready, let us add more meaning to the chart using the properties via the Chart Panels, Adorners, and Property Panel.
Now that the chart is configured with data values, let us do some customizations on the chart elements using the smart panels.
type=note
Note: We use stub data at design time and not real data. So to view the actual final chart, you need to view the chart on preview.