Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Tableau 2019.x Cookbook

You're reading from   Tableau 2019.x Cookbook Over 115 recipes to build end-to-end analytical solutions using Tableau

Arrow left icon
Product type Paperback
Published in Jan 2019
Publisher Packt
ISBN-13 9781789533385
Length 670 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (6):
Arrow left icon
Tania Lincoln Tania Lincoln
Author Profile Icon Tania Lincoln
Tania Lincoln
Slaven Bogdanovic Slaven Bogdanovic
Author Profile Icon Slaven Bogdanovic
Slaven Bogdanovic
Teodora Matic Teodora Matic
Author Profile Icon Teodora Matic
Teodora Matic
Rintaro Sugimura Rintaro Sugimura
Author Profile Icon Rintaro Sugimura
Rintaro Sugimura
Dmitry Anoshin Dmitry Anoshin
Author Profile Icon Dmitry Anoshin
Dmitry Anoshin
Dmitrii Shirokov Dmitrii Shirokov
Author Profile Icon Dmitrii Shirokov
Dmitrii Shirokov
+2 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Getting Started with Tableau Software FREE CHAPTER 2. Data Manipulation 3. Tableau Extracts 4. Tableau Desktop Advanced Calculations 5. Tableau Desktop Advanced Filtering 6. Building Dashboards 7. Telling a Story with Tableau 8. Tableau Visualization 9. Tableau Advanced Visualization 10. Tableau for Big Data 11. Forecasting with Tableau 12. Advanced Analytics with Tableau 13. Deploy Tableau Server 14. Tableau Troubleshooting 15. Preparing Data for Analysis with Tableau Prep 16. ETL Best Practices for Tableau 17. Other Books You May Enjoy

Adding color

Colors are a very useful way to enrich your visualization. In this recipe, you will learn how to add information to your visualization by selecting Dimension and adding it to Color, which is present in the Marks card.

Getting ready

Connect to your local copy of Baby_names.csv and open a blank worksheet.

How to do it...

  1. Drag and drop State from Dimensions into the Columns shelf.
  2. Drag and drop Frequency from Measures into the Rows shelf.
  3. Drag and drop Name into the Filter shelf.
  4. In the Filter[Name] window, in the General tab, make sure Select from list is selected.
  5. Click on None to deselect all values.
  6. In the search bar at the top of the list, start typing soph.
  7. Tableau will show the results that start with those letters, such as Sophia and Sophie. Select both values:

  1. Click on OK.
  2. Drag and drop Frequency to Label in the Marks card.
  3. We have now created a chart with the summed total frequency of the names Sophie and Sophia per State. But, what if we wanted to know which of the two names is more popular in which state? We will achieve that by adding Name to Color in the Marks card.
  4. Drag and drop Name from Dimensions onto Color in the Marks card:

How it works...

When you add a discrete dimension (Name) to Color, Tableau disaggregates the measure you are using, Frequency, by the categories of Name, and assigns each category a different color. Since we filtered out all names except for Sophia and Sophie, only those two colors appeared in the chart. It's also possible, and often useful, to add a measure to Color. In that case, the value measure will be represented by a color gradient. For an example of adding a measure to Color, you can refer to the Creating a map with a color gradient recipe.

There's more...

It’s possible to customize the colors in your view by performing the following steps:

  1. Click on Color in the Marks card, and then click on Edit Colors…:
  1. In the Edit Colors[Name] window that opens, you can select a color palette from the drop-down menu that appears and click on the Assign Palette button. This will assign colors from the palette that you chose to the categories of your dimension. You can also manually assign specific colors to a category by selecting it in the Select Data Item pane, and by clicking on the desired color on the right-hand side:
  1. When you are satisfied with the colors, click OK to exit. Note that this will only affect the colors in the particular view you created.
  2. You can also hardcode a color palette for a specific measure or dimension. Hover over the field pill under Measures or Dimensions and click on the white arrow that appears on it. In the drop-down menu, navigate to Default Properties | Color...:

This will launch the Edit Colors window, where you can choose the color palette. However, once you assign your desired color palette to a field this way, it will be used by default every time you add this field to Color in a view.

If you plan to use a field in Color in more than one visualization, it's a good practice to hardcode the color palette for it. Using colors in your visualizations consistently makes them cleaner and easier to follow, especially as they get more complex.

See also

You have been reading a chapter from
Tableau 2019.x Cookbook
Published in: Jan 2019
Publisher: Packt
ISBN-13: 9781789533385
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image