Here I am giving an example to change the chart bar colors based on the conditions in Oracle APEX.
Step 1: Create a new blank page.
Step 2: Create a bar chart region and your bar chart series query would then look something like this,
SELECT fund_id,
fund_name,
to_char(start_date,'DD-Mon-RRRR') start_date,
case when percent_complete >= 75 then '#d1f5e0' --light green
when percent_complete >= 50 then '#fff4dd' --light orange
when percent_complete <= 50 then '#fdd5cc' --light red
else 'blue'
end as color,
percent_complete
FROM fxgn_fund_progress order by fund_id ASC
Step 3: Do the column mappings. (Label and Value must be mapped)
Once you done the above setup, then your bar chart would then look like this,
Step 4: [Enable Conditional Bar Colors]
Click on the chart series and look for the attribute "Color" (Which you could find under the option "Appearance") and Substituting your value using the syntax &COLUMN_NAME.
Output: Output would then look like this,
The demo is here.
That's it. I hope this example will help you to understand how colors of the chart bars can be changed based on the conditions.
Happy APEXing!!!...
Awesome. Just what my chart needed.
ReplyDeleteYeah but what about using your Theme colors? ie the --u-color-5 definitions etc
ReplyDelete