cancel
Showing results for 
Search instead for 
Did you mean: 

switch between key figures but keep same colors

Former Member
0 Kudos

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,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

HI Bala,

thanks for the suggestion.

I have the scenario where the selection of checkboxes is not exclusive. That means the user can check all the check boxes or a combination or none. In that case how do i set multiple CSS classes for the same chart or can I assign multiple CSS classes fot the same chart? also i have five different measures in the LINE chart how would i distinguish the CSS classes based on them ?

Thanks,

karthik

TammyPowlas
Active Contributor
0 Kudos

Karthik - this blog by David G may help you with the script checkbox logic - see

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try following.

Set color for all Measures same in Additional Properties .

It will not pick up random/different color for any Measure .

Former Member
0 Kudos

HI Nikhil,

I assigned the colors and I need to maintain the same colors in the same order. The tool is not picking the colors by itself.

Thanks,

karthik

TammyPowlas
Active Contributor
0 Kudos

Hi Karthik - I couldn't find a straight forward way, perhaps others will

An idea that I tried was setting up conditional formatting (that always makes the key figure color the same, no matter what) - see

Former Member
0 Kudos

HI tammy,

Thanks for the reply. I am actually using the line charts and the conditional formatting applies colors to the data points(circles etc..) but not to the lines. But I think your suggestion will work well for bar charts.

Thanks,

Karthik