[]
This walkthrough shows creating a Gauge chart. The Gauge chart is placed in a multi-column list to show the units in stock in each category of products. 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, 'Products'.
Go to the Query page and enter the following query to fetch the required fields:
$.[*]
Click OK to save the changes.
Similarly, we will connect to another data source from where we will fetch [categoryName] corresponding to the [categoryId] in 'Products' dataset, in the Chart Header.
The data source URL is https://demodata.mescius.io/northwind/api/v1/Categories and the dataset query is $.[*]. Let's name this dataset, 'Categories'.
Drag-drop the List data region.
In the Properties panel, set the following properties:
Property | Value |
---|---|
DataSetName | Products |
GrowDirection | Column |
RowsOrColumnsCount | 4 |
With List data region selected, click Property dialog.
Go to Detail Grouping page, and in the General tab, provide a Name to the group and in the Group on: Expression, select =[categoryId].
Go to the Sorting tab and add a sorting Expression =[categoryId] and Direction as 'Ascending'.
We will use the Chart Wizard dialog to configure chart data values and basic customization. If you have a dataset added to your report, on Chart's drag-drop operation, the wizard appears. See the topic on Chart Wizard for more information. You can make further adjustments to the chart after you exit the wizard by accessing the properties of chart elements through dialogs, property panels, and adorners.
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: The first field should be the one with greater value.
We want chart header to display the category name from another dataset, 'Categories'. For this, we will use Lookup expression.
To open the smart panel for the chart header, right-click 'Header' on the Report Explorer and choose Property Dialog.
Go to the General page and set Title to the following expression:
=Lookup(Fields!categoryId.Value,Fields!categoryId.Value,Fields!categoryName.Value,"Categories")
Go to the Font page and set the properties as below.
Click OK to complete setting up the chart header.
You may want to resize the chart and customize other chart elements. Once you are done, press F5 to preview the report.
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 the preview.