Abinnaya
Abinnaya

Reputation: 223

how to give colors for pie chart result in apex dashboard, I have given the query used inside pie chart series

How to give colors for pie chart result in apex dashboard, I have given the query used inside pie chart series

For ex: If status is Approved then show the result in green color, if rejected then show in red color, if Pending then show-result in yellow color

Below is the query used inside pie chart region:

SELECT sum(cheque_amount) tot_Amt,
CASE
    WHEN status='Approved' THEN status
    WHEN status='Rejected' THEN status 
    WHEN status='Pending' THEN status  
END AS STATUS`enter code here`
FROM PDC_CHEQUES 
group by status

Upvotes: 0

Views: 2528

Answers (2)

EJ Egyed
EJ Egyed

Reputation: 6084

I do not have access to an APEX 5.1 environment as your tags suggest, but in my APEX 19.2 environment, when creating a Chart region that is set up to use the Pie Oracle Jet chart, you can specify the Hex number or HTML color code that the section should be. If you define a column in your SQL query that defines the color, you can reference it in the Color field using the &COLUMN_NAME. syntax.

enter image description here

enter image description here

Upvotes: 0

Scott
Scott

Reputation: 5035

You can have a column in your query define the colour you need, say

,case 
when status = 'Approved' then 'u-color-5'
when status = 'Rejected' then 'u-color-9'
end as col_colour

Then map that column to the colour attribute in the chart attributes, where you map the other columns.

These colours are defined in the UT application.

Upvotes: 0

Related Questions