You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to change legend color in pie chart

Received Response
33
Views
12
Comments
edited Mar 9, 2021 4:55PM in Visual Builder 12 comments

Summary

How to change legend color in pie chart

Content

Hi,

I have a requirement where I need show the salary of an emp in a specific color in pie chart. If its Linda it should be green and like wise. I am able to achieve this in pie chart. But not able to show same color in legends. Legends are picking up their own color which is not same as color in pie chart

 

Version

Version: 21.04.0

Code Snippet

<oj-chart type="pie" class="oj-sm-flex-initial oj-flex-item oj-sm-12 oj-md-6" style="max-width:100%;"
      data="[[$page.variables.employeeListSDP2]]" legend.title="Name" legend.rendered="on"  >
        <template slot="itemTemplate">
            <oj-chart-item value="[[ $current.data.salary ]]" series-id="[[ $current.data.name ]]"
              group-id="[[['name']]]" color="[[ $current.data.name === 'Linda Jones' ? 'green' : 
                               $current.data.name === 'James
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!