This article describes how to go from Visualizaion showing all data series in the same color...
...to a Visualization where data series are conditionally formatted. In the example below, all values above 50% are shown as green, values between 40% and 50% as orange, and values below 40% as red.
1. Create a Summary table you wish to visualize.
2. Go to Visualization > Bar > Bar.
3. Go to Inputs > DATA SOURCE > Output in Pages > select the table.
4. Select Calculation > Custom Code and draw an output on the page.
5. Update the code and paste it into Properties > R Code.
#select data table
value = table.Q4.Consider
#specify condition and colors
#you can use color names (e.g. Green) or HEX Code (e.g. #008000)
colors <- ifelse(!is.na(value), ifelse(value > 50, "Green", ifelse(value > 40, "Orange", "Red")), "NA")
# Reformat as a character vector
Note: to update the code to the values and colors you need, you can copy the fifth line of the code (colors <-...) into ChatGPT and use a prompt: update R code to return (insert your color) for values above (insert values), (insert color) above values of (insert value) and (color) for all other values. See an example here.
The code will return a table (vector) with colors corresponding to each line of the table selected in the code.
6. Select the Visualization and go to Chart > DATA SERIES > select Multiple colors in a single series.
7. Select Custom Pallette (R Output) from the Color Pallette menu.
8. Select the Calculation created in Step 5 from the Custom Palette menu.