How to dynamically change the category axis and series values in a chart

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.