Taking Dashboards from Good to Great with Custom Shapes

Contributor & Author: Tiffany Spaulding
Reference: Click Here

Many people struggle with bringing graphic design elements into their Tableau dashboards. Last week, we focused on building better dashboards using custom color palettes. This week, let’s dive into best practices for using custom shapes to enhance your Tableau visualizations.

What image file type is best?
When you perform a search on the internet for icons or shape files, typically you will have multiple file types returned: BMP, GIF, JPEG, PNG, and TIFF. Tableau can use all 5 file types; however PNGs (portable network graphics) should be your go to for two key benefits.

PNG Benefit #1: Transparent Background
On a white background, you do not notice the difference between a JPEG shape and a PNG shape. It's only when the shape is placed on a colored background that it becomes obvious why to use the PNG. PNGs have a transparent background which allows shapes to be placed on any color background without concern of an ugly white square around the icon.

Often, we need shapes to appear in close proximity to other shapes in view, overlapping at their edges in certain scenarios. Because PNGs have a transparent background, they can be arranged close to each other without concern of the background overlapping a neighboring shape. With JPEGs, the background will overlap eventually, causing undesirable effects.

Furthermore, if you use JPEG shapes on a map, you’ll be able to see the background white space quite prominently. PNGs reveal elements of the underlying map in a cleaner fashion since their backgrounds are transparent.

PNG Benefit #2: Receive Color Encoding
In Tableau Desktop, if we use JPEG shapes and add a field to color on the marks card, the entire rectangular area of the JPEG is colored, not just the icon. One-color PNGs receive color encoding as we expect since their background is transparent.

Where can I find high quality PNG libraries?
My go-to is always the Noun Project simply because I love the concept. They are an open-source global initiative whose mission is to develop a freely accessible library of icons that will translate across all cultures and languages as a visual language. The site welcomes and encourages contributions from around the world and hosts “iconathons” to encourage constant growth to their libraries. Thanks to the Creative Commons license, most are available for use in Tableau or other mediums. To get started, simply search by buzzword, scroll through the library results, and save those you want to your machine (right-click icon preview and select “Save Image As…”).

I maintain a list of other equally wonderful icon libraries on the internet. Make sure to check out the links below for millions of icons available for free.

What tools can I use to build my own PNGs?
My go-to tool is Adobe Illustrator but you can use PowerPoint as well. Yes, PowerPoint can build PNGs. Any shape, textbox, smart art, or element in PowerPoint can be saved as a PNG by right-clicking and selecting “Save as Image." I use this most often to convert text to images when sending Power Points to my team (as I tend to use some non-standard fonts). It also comes in handy when I need to preserve text on a dashboard that is an unsupported font on Tableau Server. Changing specialty text to image prevents the text from returning to a substitute font when they open the file on their machine or device. The same functionality can be used to bring in images and icons to Tableau for marks, highlights, logos, drop shadows and buttons.

To convert PowerPoint graphics to PNGs for use in Tableau, follow these simple steps:
  1. In PowerPoint, right-click the shape or text element you want to convert to PNG.
  2. Select “Save as Picture…” from the right-click menu.
  3. Name the file and choose a save location. The file type will default to a PNG.
What file size is best for PNGs?
The file size will depend on the visualization. Resizing of the shapes is limited in Tableau as the size slider (Size button on the Marks Card) has a predefined range. I tend to save three versions of my PNGs to have a low, medium, and high resolution option. Icons should never be smaller than 32 pixels by 32 pixels. I tend to save a 50x50, 125x125 and 250x250 version.

How do I add custom shape palettes to Tableau?
Once you have identified the icons you want to use, you’ll need to save them to a very specific location on your computer. Browse the “My Tableau Repository” (available to PC users in your My Documents folder). Think of the "My Tableau Repository" as Tableau’s brain. The software looks here for color palettes, log files, map sources, data sources, and more. Double-click the “Shapes” folder inside the "My Tableau Repository" and you’ll recognize that the list of folders within is the exact same as the shape palettes available by default in Tableau. 

To create a new shape palette, add a new folder within the Shapes folder (don’t forget to name the new folder). Inside the new folder, save (or copy) any of the images you want to utilize in Tableau. The next time you open Tableau Desktop, your shape palette will automatically load. If you have Tableau open while adding shapes, you can either save and restart Tableau, or use the “Reload Shapes” button from the Edit Shape menu to refresh the available shape palettes.

Remember if you are sharing your work with others through Tableau Server, you’ll either need to save your workbook as a TWBX (packaged workbook) or ensure your server admin has added the same shape palette name and contents to the Tableau Server’s repository.

Jedi Mind Tricks (Advanced Use Case for PNGs)
Sometimes we need to show worlds of information in very small spaces. Think about the process of finding a new home. We search by price, but just as important are the number of bedrooms, number of bathrooms, garage size, square footage, and school district. That is a ton of information to show in one view, however we can combine a few key metrics using iconography and place the other details in a tooltip. By utilizing PNGs, we can take advantage of the transparent background to overlay multiple icons into one informative graphic. 

I hope these quick tips help you to think outside the box of the shapes available in Tableau by default. There are multitudes of free sources to enhance the user experience. Adding iconography ensures the data translates to all users (no concern of shape deficient users like we saw with last week’s color palettes). Remember to always check your work across multiple devices (iPhone, Android, etc.) as well as to use the smallest image size needed. 

How to Create a Custom Color Palette in Tableau

Reference: Click Here
Tableau Desktop comes with a set of color palettes that have been carefully designed to work well together and effectively apply color to data in many situations, such as on maps, heat maps, bars, etc.,. Alternatively, you can add your own custom color palettes to match your corporate identity or to describe common data better.

In general, Tableau offers three types of color palettes: categorical, sequential, and diverging. You can create your own custom color palette by modifying the Preferences.tps file that comes with Tableau Desktop. The Preferences.tps file is located in the My Tableau Repository. The preferences file is a basic XML file that you can open in a text editor to modify. Unedited preferences file looks like following example:

Important: Tableau does not test or support custom color palettes, so be sure to back up your workbooks before you continue. Also, there is no guarantee that your custom color palettes will work with future Tableau Desktop upgrades. 

You can add as many custom palettes as you like, each with as many colors as you want. Make sure each palette has a unique name. The colors are indicated using the standard HTML format. This is the hexadecimal value #RRGGBB or Red Green Blue format. When you save the workbook, the color information is embedded in the file, but it is not included as a reusable color encoding. This means that any colors that are in use are shown for anybody opening the workbook; however, if they don't have the modified preferences file, they cannot use the color information for new color encoding.
Step 1: Edit your preferences file
  1. Go to the My Tableau Repository folder in your Documents directory, and open the Preferences.tps file.
  2. Between the opening and closing "workbook" tags, insert opening and closing "preferences" tags.

  1. Choose a color palette option below and follow the procedure to modify the Preferences.tps file.
Option 1: Create a custom categorical color palette
A categorical color palette contains several distinct colors that can be assigned to discrete dimension members. For example, when you put a discrete dimension such as Region on the Color, the categorical color legend is used. The following is an example of what to add between the "preferences" tags to add a categorical color palette. Note that the "type" attribute is specified as regular, which identifies this palette as a categorical palette.

  1. In the Preferences.tps file, between the "preferences" tags, paste the following:
<color-palette name="My Categorical Palette" type="regular" >
  1. Save the Preferences.tps file and then restart Tableau Desktop.
  2. Open the Superstore sample data source.
  3. From the Dimensions pane, drag the selected discrete dimension (e.g., Region) to Color.
  4. Click the color legend menu arrow and select Edit Colors.

  1. In the Edit Colors dialog box, from the palette drop-down list, select your new custom palette.

  1. Click the Assign Palette button to assign the custom colors to each respective field.
  2. When finished, click OK.

Option 2: Create a custom sequential color palette
Another type of palette is the sequential color palette. Typically, this type of palette shows a single color, varying in intensity. This type of color palette is used for continuous fields, typically for measures. The following is an example of what to add between the "preferences" tags to add a sequential color palette. Note that the "type" attribute is specified as ordered-sequential, which identifies this palette as a sequential palette. Also, for sequential palettes you must specify each variant of the color in the sequential color range.

  1. In the Preferences.tps file, between the "preferences" tags, paste the following:
<color-palette name="My Sequential Palette" type="ordered-sequential" >
  1. Save the Preferences.tps file and then restart Tableau Desktop.
  2. Open the Superstore sample data source.
  3. From the Measures pane, drag the measure (e.g., Sales) to Color.
  4. Click the color legend menu arrow, and select Edit Colors.
  5. In the Edit Colors dialog box, from the palette drop-down list, select your custom palette.
  6. If you want each color gradation to be defined within a box, select the Stepped Color check box, and in the Steps text box, type the number of color steps you want to display in the bar.
  7. Click the Advanced button.
  8. Select the Start check box, and in the text box, type the low end number you want for the continuum.
  9. Click the Apply button to see the result, and make adjustments as needed. The default for sequential color is to make the high end of the continuum pale and the low end intense; select the Reversed check box to make the high end intense and the low end, pale (this is the default when you keep the Automatic palette selection).

Option 3: Create a custom diverging color palette
The third type of color palette is a diverging color palette. A diverging palette shows two ranges of values using color intensity to show the magnitude of the number and the actual color to show which range the number is from. Diverging palettes are most commonly used to show the difference between positive and negative numbers. The following is an example of what to add between the "preferences" tags to add a diverging color palette. Note that the "type" attribute is specified as ordered-diverging, which identifies this palette as a diverging palette.

  1. In the Preferences.tps file, between the "preferences" tags, paste the following:
<color-palette name="My Diverging Palette" type="ordered-diverging" >
  1. Save the Preferences.tps file and then restart Tableau Desktop.
  2. Open the Superstore sample data source.
  3. Click the Assign Palette button. The colors in the palette are used in the order they appear in the Preferences file.

If you add a sequential or diverging palette, remember to change the "type" attribute from "regular" to one of the following:
  • ordered-sequential
  • ordered-diverging
Step 2: Assign a default custom palette to dimensions and measures and publish as a data source (optional)
After you save the workbook, the custom color palette information is embedded in the workbook (for Excel and text file-based workbooks, in the .twbx) and therefore only available for that workbook. This means that colors that are in use are shown for anybody opening that particular workbook. If they don't have the modified preferences file, they cannot use the color information for any new color encoding. To allow new color encoding using the custom color palette or to standardize a custom color palette for the Tableau workbooks in your organization, you can create the custom color palette using one of the options above, and then publish it as a Tableau Server data source.
  1. On the same computer from which you modified the Preferences.tps file, open Tableau Desktop.
  2. Open the Superstore sample data source.
  3. Right-click a field in the Data pane, and select Default Properties > Color.
  4. In the Edit Colors dialog box, associate the field values with the custom color palette, and then click OK when finished.
  5. From the Data menu, select the data source, select Publish to Server, and then complete process to publish the data source.

After publishing the data source to Tableau Server, connect any new workbooks to this data source to use the custom color palette. 

Taking Dashboards from Good to Great with Custom Color Palettes

Contributor & Author: Tiffany Spaulding
Reference: Click Here

Learning Tableau is like learning to write. We start with single letters, uppercase and lowercase before we ever build words, phrases, sentences, and paragraphs. If we focus on just the penmanship aspect, our handwriting has hopefully evolved from age 4 through now. As we evolve, we eventually develop our own style as we are exposed to alternative handwriting families: script, caps, technical, cursive, bubbly, architectural, and even the quick chicken-scratch every now and then. Through repetition, we develop and hone the skill over time. The same happens with our design style in Tableau, but instead of letters, we are learning functionality: chart types, calculated fields, filters, groups, sorts, hierarchies, and parameters.

Learning Focuses on Function:
As new users become more comfortable with Tableau, they tend to search for ways to make their dashboards stand out: testing new functionality, incorporating Jedi hacks, pushing the barriers of what was conceivable, and using other technologies to enhance Tableau. Some of the best dashboards in production utilize none of the former enhancements, just basic Tableau functionality plus a little something extra.

What Makes the Best Dashboards Different?
  • They are clean, simple, and intuitive. 
  • They don't fight Tableau but embrace its beauty. 
  • They require minimal training or orientation to use the dashboard successfully.
  • They encourage curiosity, discovery and action.
  • They balance form and function.
Great Design Respects Form and Function
The most used dashboards gracefully balance form and function. Designing minimalist dashboards takes hours and hours of effort to polish, re-evaluate, test, and redesign. Instead of simply knowing how to press buttons in Tableau, to become great in the tool, you'll need to embrace design principles such as proportion, balance, rhythm, and harmony. Knowing that most people who use Tableau have never taken a course in 2D or graphic design, I'll be sprinkling in a few posts here and there on graphic design basics and how to incorporate them into Tableau. Let's ease into our first topic: color.

Use Color Palettes That Strengthen the Data
A very simple modification you can make to any dashboard is to design the color palette relative to the story the data tells. If you are building a dashboard looking at football stats for the Houston Texans, you'd probably incorporate the Texans logo. To enhance the dashboard graphically, modify the color scheme to a Houston Texans palette. All of us have emotional ties to color. Why not utilize that emotion to strengthen the familiarity and connection of the dashboard with the end user? Intuitive color palettes increase speed of insight, giving your end user valuable time back in their day.

Step 1: Find Color Inspiration
Logos are great places to start building a color palette from, but websites and photos can work just as well. For kicks, let's pretend we are analyzing the popularity of M&Ms candy by color. We could get close by randomly choosing a yellow, green, red, blue, brown, and orange, or we could find a photo with all the colors shown and then extract the colors from the picture.

Step 2: Build the Palette
  1. If you are using Sample Superstore as your data source, drag any dimension with 6 members or more to the Color shelf on the Marks Card. I used Sub-Category and then aliased the members to the M&M colors.
  2. Using the drop down on the Marks Card, change your mark type to circle.
  3. Click the Size button on the Marks Card and move the slider all the way to the right to increase the circle sizes.
  4. Create a Calculated Field for the label. Formula = "M"
  5. Drag your new label field to Label on the Marks Card.
  6. Click the Label button on the Marks Card and adjust the formatting.
Font = White, 36pt, Bold
Alignment = Middle Center

Now that our base view is built, look closely at the legend: Blue is shown as Blue however Brown are shown as Orange. We need to edit our colors not only to ensure each color matches the name, but to the exact shade of each M&M hue.

To edit the colors, click the Color button on the Marks Card and select Edit Colors (or double click the color legend). We can reassign the color values by selecting any of the pre-built palettes from the drop down list in the top right corner of the pop-up menu. 
Side Note: In 8.x versions, this is where I would leave Tableau and utilize a color tool such as Pixie Color Picker to scrape the HTML color codes. I'd then write XML code to build a custom color palette in my Preferences file in the Tableau Repository. 
Version 9 gave us a new feature called the Color Picker to make creating ad-hoc custom palettes quicker and easier. To access the new tool, double click on the colored square for Blue in the left hand column of the pop-up menu ("Select Data Item:"). A new popup menu titled "Select Color" will appear.

  1. To begin building your palette, click one of the white rectangles in the bottom left corner under Custom colors. 
  2. Next click the "Pick Screen Color" button in the top left quadrant of the pop up menu.
  3. Click anywhere you want to pull the M&Ms blue color from. (Having dual monitors makes the process a little easier, but you can navigate to another program and it will read the next click.)
  4. Click "Add to Custom Colors" to save the color to your palette. 
  5. Press OK.
  6. Rinse and Repeat selecting the second data item in the list at the left of the Edit Colors menu. Work your way through all 6 colors.

Our original view of the M&Ms now match the exact colors of the candy coating, bringing familiarity and relativity to the data simply through color, shape, and label. 

Caution: Building color palettes through the Pick Screen Color option is designed for ad-hoc purposes. You are limited to 16 colors in your palette and it is only active in the existing workbook while it is open. Once you save and close the workbook, the Custom Colors will return to white rectangles once again. Any data points assigned to your custom colors will remain encoded. 

Step 3: Check the Palette for Color Deficient Viewers
Tableau has invested heavily in developing their color palettes to span the most users. Should you choose to develop your own, please use an app such as Vischeck to ensure your new custom color palette is friendly to color deficient viewers?

Step 4: Save Palette for Future Use

If you need to share color palettes or save them for use across multiple workbooks, check out this article on how to write XML code in your Preferences.tps file. If you would like Tableau developers to build in an option to save a Custom Colors palette from within the pop-up menu, please upvote this post in the Community.