4 Replies Latest reply: Jul 7, 2011 9:29 AM by Johan Idh RSS

    Continuting colors on multiple graphs

      Hello everyone,


      I had a question regarding colors. At the moment i have two bar graphs running. The first one, for example, uses a base and calculates the number of individual entries. (A,B,C,D). The second one contains the base, with a index number next to it, regarding an issue (A1, A2, B1, B2, B3, C1, etc.)


      my question is: would there be a way to sync colors between the two graphs? For example, on the first bar graph, the bar "A" is Red, "B" is Blue, "C" is green, and making the second graph reflect that such as "A1" is Red, "A2" is Red, "B1" is blue, and so on.


      Qlikview also recognizes the two charts with listboxes, so if i select "A" from a list box, "A1" and "A2" both come up in the graphs



        • Continuting colors on multiple graphs
          Leonard Short

          In your chart properties, click on the + next to your expression. Select 'Background Color' and on the right open the expression editor under definition.


          From there, its just an if statement, if(entry = A, red, if(entry = B, blue,if(entry = C, green,if(entry = D, yellow))))

          There are several ways you can set the color codes in the above statement I tend to use rgb(0,0,0) type format.


          Copy & paste the final if statement to any chart you want to have the same color scheme for.

            • Re: Continuting colors on multiple graphs
              John Witherspoon

              Alternatively, map yourself some colors:


              LOAD * INLINE [
              entry, R, G, B


              And then in the color expressions:




              Though you'll probably want this so that you get default colors when adding new values that you haven't mapped:



                • Re: Continuting colors on multiple graphs

                  thanks for getting back to me...i tried your method, and for some reason, all of the bars come up as jet black (rgb(0,0,0)). I cant seem to figure out why this is.


                  in my script, I added



                  LOAD * INLINE [

                  entry, R, G, B


                  In the background color expression, i added




                  for some reason, doing this turned every entry jet black. Any ideas on what might be the fix for this?