WeeklyAlteryxTips#88 How to freely set the color of a heatmap

Alteryx

This blog series, titled “AlteryxTips,” will feature helpful Alteryx tips delivered weekly by AlteryxACE AkimasaKajitani.

Alteryx Interactive Charts are useful because they can create a wide variety of visualizations, including heatmaps.

Heatmap Color Settings

For this heatmap, you can select only from a predefined set of color palettes.

When you click the color scale here, the basic scales shown below appear, and you can choose one of them.

There are three series of color palettes. If you click the area labeled “sequential scales,” you can choose from the three types shown below.

divergent scales:

This color setting uses different colors extending in both directions from a central point.

categorical scales:

This uses a colormap-style color scheme.

Freely Changing Colors Using XML View

By default, heatmap colors cannot be customized freely. To change them, you need to edit the XML directly.

XML View

First, let’s look at it in XML View. You can open XML View by clicking the icon resembling “<>” in the configuration window. However, this icon is hidden by default, so you need to change the settings first.

To do this, open [Options] – [User Settings] – [Edit User Settings] from the menu and change the setting.

Select “Display XML in Properties Window,” as shown above. The XML View icon will then appear as shown below.

Clicking this icon displays the XML as shown below. To modify it, click the “Edit” button in the upper-right corner.

When you click it, the XML editor opens as shown below.

On closer inspection, however, there does not seem to be any color setting in this XML.

Some XML Elements Appear Only After Changing Default Values

Be aware that some XML elements do not appear until their values are changed from the defaults. The color setting is one such element.

If you change the color setting to any other option, the XML will look like the example below. The portion highlighted in red is the newly added color setting.

In other words, you simply need to rewrite the colorscale tag. Because it uses standard HTML color values, you can identify the desired colors by using resources such as the website for looking up HTML color codes.

Rewriting it produces the result shown below.

Conclusion

  • This article explained how to freely customize heatmap colors in the Interactive Chart tool by editing the XML.

Sample Workflow Download

Next!

Next time, I’ll cover a similar topic again…

コメント

Copied title and URL