Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Set Pie Chart Colors based on label value

Barry BrierleyNov 1 2018 — edited Nov 1 2018

Hi,

I'm on 18.1 and have a pie chart that looks like this:

pastedImage_5.png

It is a RAG status PIE chart, values can only be R, A, G (red, amber, green).

Here is the query.

select nvl(upper(rag_status),'G') label, count(*) value

from xxcq2_defect

where deploybkt = 01

group by nvl(upper(rag_status),'G');

I have found some code which succesfully changes my series colors if plugged into the javascript initialisation code of the region attributes for my chart.

function(options) {

options.dataFilter = function(data) {

data.series[0].color = '#573366';

data.series[1].color = '#cb231a';

data.series[2].color = '#277256';

return data;

};

return options;

}

I beleive that I'm on the right track. can somebody please help me to enhance this code so that the color is set to the series value.

I can easily change my SQL to be Red, Amber, Green instead of R,A,G if it helps the java code.

Thanks.

This post has been answered by AndrewSayer on Nov 1 2018
Jump to Answer
Comments
Post Details
Added on Nov 1 2018
3 comments
4,469 views