2 Replies Latest reply on Oct 1, 2018 6:05 PM by Ken Flerlage

    Color all negative values of a heatmap black?

    John Salazar

      Hi,

       

      I would like to make a heatmap of a field on a red gradient, but make all negative values black.  I tried red-black-white diverging (reversed), but I do not want the white shades in between.  I basically want the gradient to start on positive numbers at red instead of white.

       

      Please let me know if this is possible.

       

      Thanks,

      John

        • 1. Re: Color all negative values of a heatmap black?
          Deepak Rai

          Can you attach some workbook to help you?

          • 2. Re: Color all negative values of a heatmap black?
            Ken Flerlage

            The problem is that most of the built-in diverging color palettes go from one color to another meeting at white or grey in the middle, but you can create your own custom palette that does not do this. Here's how: Create Custom Color Palettes

             

            I created the following palette that goes from black to a bright red:

             

            <color-palette name="Black/Red Diverging" type="ordered-diverging" >

            <color>#000000</color>

            <color>#FF0000</color>

            </color-palette>

             

            Using superstore, I dropped Profit on the Color card, then chose this palette:

            However, it still shows a range of colors (not all negatives are black), so I created a calculated field as follows:

             

            Color

            IF SUM([Profit])<0 THEN

                0

            ELSE

                SUM([Profit])

            END

             

            I then dragged this to the color card and chose the palette:

            Close, but one of the problems with this is that low values still show very black. If you want postitive values to be more red, then you can fiddle with the color palette settings. For example, here I've selected "Use Full Color Range" and set the Center at 500:

            See attached workbook.

            2 of 2 people found this helpful