I. Overview
1.1 Problem
In [Chart]>[Special Effects]>[Conditional Display], data between series cannot be directly compared.
Now we want to achieve the comparison of the values between the series as shown in the figure below. When the Household sales volume is less than the Digital products, the column color becomes red.
1.2 Solution
Through comparison between the series using JS, and change the color based on the comparison.
II. Sample
2.1 Report design
Create a new data set ds1, the database query statement is:
SELECT * FROM SALES_BASIC
Merge the cells of a region, insert a column chart, and bind the chart data as shown below:
In the [Style]>[Label] settings, select [use label], select [Custom] for the text, enter the following JS code in a text box:
function(){
if(this.points[0].value<=this.points[1].value)
this.points[0].color="red";
}
2.2 Preview effect
1.PC
Save the report and click [Pagination preview]: