3 Replies Latest reply: Dec 12, 2011 4:23 AM by daniel_k RSS

    color gradient

      Hello all,

       

      is there an option to dye numerative data gradualy.

      so that e.g. 100% are colored "red" and 1% is colored "green".

       

       

      I would be thankful for any advice.

      greetings

      daniel

        • color gradient
          jagan mohan rao appala

          Hi,

           

          I don't know whether I understood correctly, please check the attached image if you are expecting the same download QVW file from the below URL

           

          http://ap.demo.qlik.com/QvAJAXZfc/opendoc.htm?document=qvdocs/Sales%20Management.qvw&host=Demo11

           

          Refer Products tab and Margin (Heat chart)

           

          Gradient.PNG

          Hope this helps you.

           

          Regards,

          Jagan.

          • Re: color gradient
            Stefan Wühl

            Daniel,

             

            if you have a field with values between 0 and 1 (0 to 100 %), e.g. called Dye%, your background color attribute (e.g. in expression tab, open the attributes by clicking on the + sign next to the expression) could look like this:

             

            =RGB(255* Dye% ,255-255* Dye%,0)

             

            This looks like to be equivalent to using the colormix1 function:

            =ColorMix1(Dye%,LightGreen(),LightRed())

             

            If you want to get blue in the middle of the range, it could look like

            =RGB(255*Dye%,255-255*Dye%,256-2*fabs(127-255*Dye%))

             

            or (this looks different, more pure blue):

            =colormix2(Dye%*2-1,LightGreen(),lightred(),LightBlue() )

             

            See also attached,

            Stefan

              • Re: color gradient

                hi stefan,

                 

                thanks for your explanation. it was very helpful,

                 

                the "rgb" formula works fine in the range from 0 to 1        !

                 

                 

                but how should a formula be defined , that

                a) works in a range  form  " 0 to 100 "

                and

                b) is it although possible to dye dimensions, that are containing e.g. total amount of turnover?

                 

                greetings

                daniel