cancel
Showing results for 
Search instead for 
Did you mean: 

How to get color palette value?

Former Member
0 Kudos

When I click on any sector of pie chart, I want to access the color palette of that particular sector.

How can I do that?

For instance

When i click on "green" sector, I want to store "green" in some variable.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

saivellanki
Active Contributor
0 Kudos

Hi Kiran,

Will this sample help? Plunker

Regards,

Sai Vellanki.

prasad
Participant
0 Kudos

Hi sai, can you please let me know how can i print the value revenue on the pie chart .it is being shown when we hover basically the value should be printed on pie chart sector please do the needful. Thanks Prasad

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kiran,

You can follow sai solution or you can use below snippet as well:

oVizFrame.attachSelectData(null, function(event) {

                var oTarget = event.getParameters("data").data[0].target

  var oRect=oTarget.childNodes[0]

  var sRequiredColor = oRect.getAttribute("fill"); /*It will return required color*/

  alert(sRequiredColor);

            })

Regards

Naveen S

Former Member
0 Kudos

For me

oControlEvent.getParameters("data").data[0].target.childNodes is coming as an empty array.

Regards

Former Member
0 Kudos

Hi Kiran,

If you share the sample code,we can check what is the issue,because above snippet is working perfectly for me..

Regards

Naveen S