Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

switch between key figures but keep same colors

Hi All,

i have a chart in which i have 5 different key figures. I have 5 different check boxes which either show or hide each of the one above. i have assigned colors as below. i used setDataSelection() to switch kFs

KF1: red

KF2:blue

KF3:green

KF4:orange

Kf5:grey

Issue: The chart colors are applied in the same order no matter what KFs are selected to display. For ex if i select to display KF3 and KF4 they are showing up with red and blue respectively instead of green and orange.

Please give me your inputs on how to configure the charts to avoid above situation.

Thanks,

Tags:
Former Member
Former Member replied

Hi Karthik,

If u want to change the color of the bar chart when selecting the check boxes then u should use custom css to change the colors.

.customChart1 g.v-column g.v-datashape:nth-child(1) rect.v-datapoint.v-morphable-datapoint {fill: yellow}

.customChart1 g.v-legend-content g.v-row.ID_0 path {fill: yellow;}

use this code, create a separate class for each color  (here custom Chart1 is the class name for yellow color )in the CSS  and while clicking on the checkbox  use the setcss function to call the specific class. i have already tested this its working fine.

Regards,

Bala

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question