6 Replies Latest reply: Nov 20, 2015 8:53 AM by Razor Ramon RSS

    Dynamic background colour for bar chart

      Hi guys,

       

      Need some help with this.

       

      I have some data and it contains fields such as Question 1, Question 2 all the way to 10.

       

      Each question has a score of 1 to 4 with 1 being poor and 4 being excellent.

       

      The information is represented in a bar chart for each question and I am coding the colours as follows:

       

      Chart 1

      if(Questions_1_Score  = 1, red(),

                                        if(Questions_1_Score =2, rgb(255,128,0),

                                              if(Questions_1_Score =3, yellow(),

                                                  if(Questions_1_Score =4, green()))))

       

      Chart 2

      if(Questions_2_Score  = 1, red(),

                                        if(Questions_2_Score =2, rgb(255,128,0),

                                              if(Questions_2_Score =3, yellow(),

                                                  if(Questions_2_Score =4, green()))))

       

      Chart 3

      if(Questions_3_Score  = 1, red(),

                                        if(Questions_3_Score =2, rgb(255,128,0),

                                              if(Questions_3_Score =3, yellow(),

                                                  if(Questions_3_Score =4, green()))))

       

      Now I don't want to write 10 expressions that are the same thing with only the dimension name changing.

      Is there a way to have just one expression that can cater for all 10, and if possible, any suggestions please?

       

       

      Thank you