How to dynamically change the category axis and series values in a chart
We have added chart elements in some special reports, but the classification axis and series values are usually fixed.
Is there any way to change the category axis and series value based on the situation? The method is as follows:
Report development tool used: FineReport
The system database FRdemo is used, as shown in the following figure:
1. Direct Display Effect
2. Click the product category and the TV effect under the Home Appliance
3. Click the product category data product's digital camera Effect
4. Click the provincial/provincial category data salesperson name.
The specific implementation steps are as follows:
1. The code for defining the ds1 and ds2 data sets is as follows:
Ds1: SELECT * FROM [SALES_BASIC]
Ds2: SELECT $ {horizontal axis} as horizontal axis, $ {series} as series, $ {value} as Value
FROM [SALES_BASIC]
Where 1 = 1
$ {If (len (diqu) = 0, "", "and region = '" + diqu + "'")}
$ {If (len (xiaoshouyuan) = 0, "", "and salesman = '" + xiaoshouyuan + "'")}
$ {If (len (chanpinleixing) = 0, "", "and product type = '" + chanpinleixing + "'")}
$ {If (len (chanpin) = 0, "", "and Product = '" + chanpin + "'")}
2. Add a floating element-icon-column chart
3. In the hyperlink, you need to add the chart hyperlink-linked floating elements and corresponding icon parameters.
Functions and Code are not very complex, but they just give you more freedom to choose from.
We hope to have more opportunities to share with you.