Custom Theme Palettes in Tableau

Usage / Implementation of Custom Themes 

While Tableau features several very nice themes that help to accentuate your data, the standard themes don't really differentiate your dashboard from others. You can create your own theme to match your company / desired theme for your dashboards. This guide will show you clearly how to create your own theme either using Adobe Illustrator or a free-to-use online tools I found the other day.

STEP 1: Gather Hex Codes 

Tableau determines colors based off of Hex Codes, which are unique alphanumeric identifiers for specific colors. While these can be daunting to look at, their usage is quite simple. Here's steps to find some using both Illustrator and a web source. 

A. Online Web Source 

If you navigate to https://www.color-hex.com, you are given the ability to create custom color palettes relatively simply online for free. While it doesn't give the user as much guidance on good color pairings for color palettes as Adobe Illustrator does, the product gives the consumer the same amount of ability to create palette themselves. 
Now that you are on the site, go to the tab called "Latest Palettes" and click on it. This will lead to a page that looks like this: 
This page shows all of the community sourced palettes that can be integrated into Tableau. This has some advantages to Adobe Illustrator because it is community driven and shows what is popular. For the sake of this example, I will be using the City After Dark palette. Once you have clicked on this palette, this screen will appear:

Now, you must take note of HEX numbers on the page and save them for the next step.

B. Adobe Illustrator

Adobe Illustrator is a power vector graphic tool that is an industry standard. Although I thoroughly enjoy this software, its lofty price tag makes it very cost prohibitive. Anyways, here's how to use it. Create a blank document and ensure that: 
  1. You have the color window enabled (from Window --- Colors in the header of the page) 
  2. You have the color guide window enable (From the same place *see below*)
Now, create 4 (or as many colors you want in the palette) circles using the circle tool (keyboard shortcut -- L). Set the colors for these to whatever color you want the swatches to inherit and then double click the fill square after selecting a circle with the color you want. 
Double clicking this square will show you the Color selector. In the bottom right is the Hex Code which you will need later once we import the themes into Tableau (As shown below).
Additionally, Adobe Illustrator can give you suggestions for complementary or diverging colors by using the Color Palettes tool. By enabling this powerful tool, you can craft beautiful working palettes. Usage of this tool is fairly self explanatory; once you have it enabled using the above steps, just click on a complementary color to apply it to the shape for your palette.

STEP 2: Apply to Tableau

This is where things get weird. Locate your Tableau Repository called "My Tableau Repository". That's normally found under your documents folder (both Windows and Mac). From there, find the Preferences.tps file. 
NOTE: You must open this file in either Text Edit (on Mac) or Notepad (Windows). 

You'll notice that this is the screen you will see: 
<?xml version='1.0'?>

<workbook>
</workbook>
Inserting themes in Tableau is done in between the <workbook> and </workbook> line. The methodology has been covered by Tableau before but I'm covering it in order to show the usage of the online palette tool and Illustrator in aiding this process.
In order to demo the process of including a theme to a worksheet, I'm going to use the City After Dark theme shown above. To implement this theme into Tableau, you would need to replace the Code in the Preferences.tps file to:
<?xml version='1.0'?>
 
<workbook>
<preferences>
 
     <color-palette name="City at Dark" type="regular" >
     <color>#080b12</color> <color>#0c132e</color> <color>#273c50</color> <color>#5d807f</color> <color>#8ba691</color> </color-palette>
 
</preferences>
</workbook>
VERY IMPORTANT: I struggled with this for  a while, but if you're using a Mac, the Quotation marks will default to curly quotation marks that look like double commas. You need to use the straight quotation marks that look like this: "". I would just copy and paste it since working within Text Edit will give you curly quotes.

STEP 3: Enjoy Responsibly

That's it. Now you're all set. Now when you go to the marks card in tableau, you will see "City at Dark" under the colors options. Note that this will only appear for independent variables that are static if you made a "regular" palette. If you want a custom color palette for dependent variables (like sales), replace "regular" with "custom sequential". Thanks!


Comments

Popular posts from this blog

Business Policy Update

Easily Sourcing Geographic Data Via Google Maps