Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Dynamic Bar Chart Coloring: Adjusting Color Based on Slider

I want to dynamically change the color of individual bars on a bar chart based on the survey selected in a slider. However, I'm encountering difficulties as the data is organized in different columns of the table, leading to all bars changing colors instead of just the selected one.

 

Survey one has survey code 1, etc. So if you select survey 9, the only bar that changes color is the "good_quality" bar, and if you select survey 5, the only bar that doesn't change its color is the "Good_contact" bar. The color for the bars that correspond with the answers of the survey will become green, and the bars that are not selected are red.

 

The data structure looks as follows: 

 

 

The dashboard looks as follows

 

1 Reply