Overview
Expected Effect
Ensure that when you create a chart, the chart title can display statistical information, such as the number of series or categories, as shown in the following figure.
Implementation Method
Insert a statistical formula into the chart title using the combination of the COUNT() and UNIQUEARRAY() functions.
Example
Data Preparation
Create a general report and create a dataset named ds1. The database query is SELECT * FROM Sales_Volume.
Report Design
1. Merge required cells, and choose Column Chart > Column Chart, as shown in the following figure.
2. Select the cell where the chart is located, choose Cell Element > Data on the attribute panel, and bind the data to the chart, as shown in the following figure.
3. Select the cell where the chart is located and choose Cell Element > Style > Title on the attribute panel. Select Show Title, click the Formula icon, and insert the formula in title text:
"Product Sales Statistics Chart("+count(UNIQUEARRAY(ds1.select(Salesperson)))+" Salespersons in Total)"
Effect Display
1. PC
Save the report and click Pagination Preview. The following figure shows the preview effect.
Mobile Terminal
The report can be previewed on both the DataAnalyst app and the HTML5 terminal. The following figure shows the effect.
Template Download
Click to download the template Statistics Info in the Chart Title.cpt.
Notes
The above method does not apply to the titles in custom styles of components in dashboards, as shown in the following figure.