I. Overview
1. Expected effect
When making a chart, the title can display statistical information, such as how many series or categories, etc., and the effect is shown in the following figure:
2. Implementation ideas
Insert the statistical formula in the title of the chart, using the combination of functions COUNT() and UNIQUEARRAY().
II. Example
1. Data preparation
Create a New General Report, create a new data set ds1, the database query statement is: SELECT * FROM Sales_Volume
2. Report design
1) Merge a range of cells and insert a Column Chart, as shown in the figure below:
2) Select the cell where the chart is located, select Cell Element>Data in the property panel, and bind the chart data as shown below:
3) Select the cell where the chart is located, select Cell Element>Style>Title in the property panel, check Show Title, click the Formula button, and insert the formula into Text:
"Product Sales Statistics Chart("+COUNT(UNIQUEARRAY(ds1.select(Salesperson)))+" salespersons in total)"
3. Effect preview
1) PC
Save the report, click Pagination Preview, the effect is as shown in the figure below:
2) Mobile
III. Template download
The completed template can be found in:%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\Chart\Chart Title Shows Statistics.cpt
Click to download the template:
IV. Matters needing attention
The above method does not apply to the title in the custom style of the component in the decision-making report, as shown in the following figure: