9 Replies Latest reply: Feb 1, 2013 6:06 AM by Brian McKenna RSS

    Custom Colors on Bar Chart

      How can I set the color for the values in say a field called Product Group, e.g.Choclate = color Brown, Snacks = color Blue AND

      set the color for each Product, in thier respective Product Group, e.g. Aero = color Red, , Crisps = color Green etc.

        • Re: Custom Colors on Bar Chart
          Mohit Sharma

          hiich

          see the attached image

          I set the color for the values in say a field called Product Group, e.g.Choclate = color Brown, Snacks = color Blue AND

          set the color for each Product, in thier respective Product Group, e.g. Aero = color Red, , Crisps = color Green etc.

          acc. to this

          you put expression i.e

          if(Product Group='Choclate',color(Brown()),

          if(Product Group='Brown',color(Blue()),

          if(Product Group='Aero',color(red()),

          if(Product Group='Crisps',color(green())))))

          hope it helps..

            • Re: Custom Colors on Bar Chart

              Hi,

               

              Thanks for the response.

               

              Your code will for Chocolat will work fine, if(Product Group='Choclate',color(Brown()), but

              e.g. Aero, Snickers etc are Products in a seperate field e.g called Products and each product needs a seperate

              color.

              Your code results in the Products having the color Brown, Aero inherits Brown instead of showing Red.

               

              What I need to see is

              Choclat (Product Group field) = Brown

                Aero    (Products field)        = Red

               

              I'll also be using drill down in the Stacked Bar Chart.

               

              Thanks

              • Re: Custom Colors on Bar Chart

                Hi,

                 

                Thanks for the response.

                 

                Your code will for Chocolat will work fine, if(Product Group='Choclate',color(Brown()), but

                e.g. Aero, Snickers etc are Products in a seperate field e.g called Products and each product needs a seperate

                color.

                Your code results in the Products having the color Brown, Aero inherits Brown instead of showing Red.

                 

                What I need to see is

                Choclat (Product Group field) = Brown

                  Aero    (Products field)        = Red

                 

                I'll also be using drill down in the Stacked Bar Chart.

                 

                Thanks

              • Re: Custom Colors on Bar Chart
                Mohit Sharma

                i m confused in it now you say clearly that product is separate field

                so for in above code for aero try this

                if(Product ='Aero',color(red()),

                if(Product ='Crisps',color(green()))

                hope it helps

                • Re: Custom Colors on Bar Chart

                  Sorry for the confusion.

                   

                  All values in the Product field inherit the Color Brown from if(Product Group='Choclate',color(Brown())

                  Using  if(Product ='Aero',color(red()) is ibeing ignored,

                   

                  Thanks

                  • Re: Custom Colors on Bar Chart
                    Mohit Sharma

                    try this code.

                     

                    alt(if(Product Group='Choclate',color(Brown()),

                    if(Product Group='Brown',color(Blue()),

                    if(Product ='Aero',color(red()),

                    if(Product ='Crisps',color(green()))))))

                    hope it helps

                    • Re: Custom Colors on Bar Chart
                      Gabriel Oluwaseye

                      Hi QlikQuest,

                       

                      I am assuming I understand what you want to achieve!

                       

                      What you can do is click on the chart > Properties > Expression > click the + sign beside dimension > click Background color > then to the right side click the ecllipse (...) and paste this expression into the EDIT EXPRESSION window

                       

                      if(Product Group='Choclate',color(Brown()),

                      if(Product Group='Brown',color(Blue()),

                      if(Product Group='Aero',color(red()),

                      if(Product Group='Crisps',color(green())))))

                       

                      Click OK & OK

                       

                      Regards,

                      Gabriel

                      • Re: Custom Colors on Bar Chart

                        Er,

                         

                        I;m afraid that still doesn't work

                         

                        All products, i.e. Aero are inheriting the Color Brown set by, if(Product Group='Choclate',color(Brown())

                         

                        Thanks for sticking with it

                        • Re: Custom Colors on Bar Chart

                          Gabriel,

                           

                          Thanks for your suggestion.

                           

                          However what I need to see is

                          Choclat (Product Group field) = Brown

                            Aero    (Products field)        = Red

                            Mars Bar  (Products field)        = Orange etc

                           

                          Your code results in All products Aeroet in the Products field being colored Brown.